Ever wanted to get rid of files that you have not accessed in your server after backing it up? Storing a great deal of data in a machine and making backups of the same information again and again is not so useful, since some files are not meant to be modified after being sent on the server and are not used by anyone (so no one will miss them if they cannot access them directly), and they can always be found in a backup.
Using WinAutomation, you can create a job that will do this for you, without you having to go through each files properties again and again and check which files have been modified since your last backup.
To start with, we make sure we get the current date.
We open the FTP Connection and we can either type the information of the ftp connection so that no user intervention is needed, or if we will be using the same job for more than one connections we can set up input dialogs to specify our options every time.
We should then get the list of the FTP Directory of our FTP Connection and we tell it to check the last modified properties of each file and compare it to the current date, so that we know whether it has been modified within the last 14 days.
If the file has not been modified within the last 14 days, it has been told through the if condition that it should delete it.

This can also work for local machines and folders, there’s an example in WinAutomation, within the Intermediate section of the preset Examples that allows the user to find the files that have been modified since Yesterday. Using the same philosophy, we can customize this job to get an equivalent “delete files” of a folder that runs on our computer.

I am wondering about this code, because you evaluate %DaysOld% prior to setting it's value! Step 9 should be ahead of step 8. You may get lucky and have things work anyway but it isn't guaranteed.
Cheers! It'll show now! ;)
First image in the series doesn't display. Link seems to be broken. ;)
Post new comment