How to purge old files from a directory using SureSync

SureSync can be used to purge old files out of a directory based on modified dates. This is useful to clean out directories which store things such as temporary work files which are processed and then are no longer needed. To configure SureSync to purge old files from a directory do the following:
  1. Create a new Job.
  2. Add the one path to the remote machine. If it is an agent machine, don’t forget to select the agent.
  3. Click <Next> which will take you to the Rule Wizard, where you only have two selections, Delete and Skip.
  4. Select Delete, and just click <Next> to all the other panels. The File Mask defaults to ’*.*’ all files.
  5. After your Delete Job is created, expose the Rule, and go to the Dates tab.
  6. From the Dates tab, check ’Apply this Rule only when the file modification date is between these ages’. The key word here is ’ages’. You will specify files older than x days.
  7. In the first ’Days’ field, key in the number of days, after which you want to purge. For example, if you want to keep files up to 150 days, key in 151. Files which are 151 days old or older will be deleted.
  8. In the second ’Days’ field, key in 9,999. This is just the upper limit.
  9. Click <Apply>.
  10. Preview the completed Job first to ensure it is deleting the correct files before actually running the job.
The way this Job is configured is selecting files based off a "number of days" so no modification of the Job is necessary going forward. If you schedule this Job to run once a month, it will always just delete files older than 150 days from the date of the execution of the Job.

Note: You can also configure SureSync to delete files based off a specific range of dates. For example, all files with modified dates from 1/1/2008 through 1/31/2008. However, this is not as useful in this particular scenario because it would require a Rule change every time you planned to run the purge.