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.


download_current_date.s

Download

This script logs onto an FTP server and downloads all files where the modified date is today.

Note: With a little more work you could make a script to download files modified in the last 10 minutes.


  1  WORKINGDIR "c:\local\download\folder"
  2  FTPLOGON "My Remote Site"
  3  IFERROR RETURN
  4  :get_file_stats
  5  ;; The next line populates variables %sitefile and %sitefiledate
  6  FTPGETFILE "*" /newest 
  7  IFERROR RETURN $ERROR_SUCCESS
  8  IFDATE< %sitefiledate %date RETURN $ERROR_SUCCESS
  9  RCVFILE %sitefile
 10  IFERROR RETURN
 11  GOTO get_file_stats

Browse complete list of scripts