FTP - Delete Files Older than 30 Days

Delete files older than 30 days via FTP

This sample task will demonstrate how Automate can delete files older than 30 days via FTP. AutoMate will do the following: 

1. Logon to a FTP server. 
2. Execute the "Get long file list" command using Automate's FTP Advanced action and populate a dataset with the results. 
3. Loop through the dataset FileList, which has a list of files and folders on the FTP server. 
4. An expression is then used in the If action to get a day differential between today's date and the date of the file on the FTP server. If the file is older than 30 days, it is then deleted.

The %DateDiff()% function returns the number of intervals between two dates. The interval values can be second, minute, hour, week of year, weekday, day, day of year, month, quarter, or year.

Task Category: