Script Library

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.


Encrypt_and_Upload.s

Download

Encrypt a file with PGP, log onto an FTP site, upload the PGP encrypted file, and finally log off the server. This script also demonstrates some techniques for issuing error handling commands, including deleting the local files once they have been successfully uploaded.


  1  ;;
  2  ;; Encrypt file
  3  ;;
  4  PGPENCRYPT "datafile.txt" "datafile.txt.pgp" /encryptfor=username_for_recipients_key
  5  IFERROR RETURN
  6  ;;
  7  ;; Logon to FTP site
  8  ;;
  9  FTPLOGON "ManagedSite"
 10  IFERROR RETURN
 11  ;;
 12  ;; Upload encrypted file to FTP site
 13  ;;
 14  SENDFILE "datafile.txt.pgp" /delete 
 15  IFERROR RETURN
 16  ;;
 17  ;; Clean up source file
 18  ;;
 19  DELETE "datafile.txt"

Browse complete list of scripts