Sample scripts are provided as-is with no warranty of fitness for a particular purpose. These scripts are solely intended to demonstrate techniques for accomplishing common tasks. Additional script logic and error-handling may need to be added to achieve the desired results in your specific environment.
update_web_site.s
This script logs onto the server at ftp.robo-ftp.com and sends all HTML and JPG files for which there are updated versions in the working directory.
1 LOOPCOUNT 3
2 :LogonLoop
3 ;; Logon to web site
4 FTPLOGON "ftp.robo-ftp.com" /timeout=60
5 IFERROR= $ERROR_SUCCESS GOTO Operation1
6 LOOPTO LogonLoop
7 ;; Try again for up to 3 attempts
8 STOP
9 :Operation1
10 LOOPCOUNT 3
11 :FileLoop1
12 ;; Send all new HTML files
13 SENDFILE "*.html" /ifnewer /timeout=60
14 IFERROR= $ERROR_SUCCESS GOTO Operation2
15 ;; Try again for up to 3 attempts
16 LOOPTO FileLoop1
17 GOTO Disconnect
18 :Operation2
19 LOOPCOUNT 3
20 :FileLoop2
21 ;; Send all new JPG files
22 SENDFILE "*.jpg" /ifnewer /timeout=60
23 IFERROR= $ERROR_SUCCESS GOTO FileLoop3
24 ;; Try again for up to 3 attempts
25 LOOPTO FileLoop2
26 :Disconnect
27 FTPLOGOFF
28 :Exit
29 EXIT