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.
During script processing, Robo-FTP's connection to the remote server can drop for a number of reasons. For example, some servers intentionally drop the connection if no file transfer activity takes place right away. A connection can also drop due to issues in the network, etc. This sample script shows one strategy for detecting when a connection has dropped, reconnecting, and resuming work.
1 LOOPCOUNT 3 2 :retry 3 FTPLOGON "sitename" 4 FTPCD "/outgoing" 5 6 :next 7 GETSITEFILE "*" 8 IFERROR= $ERROR_NO_FILE_FOUND goto done 9 IFERROR goto pause_retry 10 RCVFILE %sitefile /delete 11 IFERROR GOTO pause_retry 12 goto next 13 14 :done 15 RETURN $ERROR_SUCCESS 16 17 :pause_retry 18 set last_error = %lasterror 19 FTPLOGOFF 20 PAUSE /for=30 21 LOOPTO retry 22 RETURN last_error