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.
download_and_decrypt_all.s
Many Robo-FTP script commands, such as PGPDECRYPT, are designed to operate on a single file and therefore do not support using wildcards.
You can still use these commands with files where the file name is not known ahead of time by combining them with GETFILE, FTPGETFILE, GETNEXTFILE, GETSITEFILE and related commands that are designed to scan local or remote directories and return information about the files it finds.
This sample script connects to a remote FTP server and uses GETSITEFILE to return information about each file it finds. It then downloads and decrypts each file.
See the Help file for more details on the usage of these commands.
1 FTPLOGON "ManagedSiteName"
2 IFERROR RETURN
3 :loop
4 GETSITEFILE "*.pgp" /oldest
5 IFERROR= $ERROR_NO_FILE_FOUND RETURN $ERROR_SUCCESS
6 IFERROR RETURN
7 RCVFILE %sitefile /delete
8 IFERROR RETURN
9 PGPDECRYPT %sitefile "" /pw=keypassphrase
10 IFERROR RETURN
11 GOTO loop