File Deletion Utility

DELETEOLDER [-nmins] [-hhours] [-ddays] [-mmonths] [-yyears] [-r] [-q] filespec [filespec...]

The DELETEOLDER program deletes files older than the specified number of minutes, hours, days, months or years. One and only one time-period specifier (-n, -h, -d, -m, -y) must be given.  To use this program as part of an automatic housekeeping program, see the System Housekeeping topic.

A $worker_box FS file DELWEEK.FS is provided, along with DELWEEK.IIF and DELWEEK.CMD, to perform regular deletions.  We recommend that you carefully check DELWEEK.CMD to ensure that it includes only the files you wish to have deleted.

If the -q option is given, the program first displays a list of the files to be deleted then waits for confirmation. Do not use the -q option if you use this command in a batch file to automate deletions.

The syntax for 'filespec' is as follows:

Each filespec is separated into path and filename elements.

When a UNC path is given, wildcards (* and ?) may be given in any path element other than machinename and sharename.  Wildcards are also not supported to search for Windows 'special folders': for example A* will not find "APPDATA".

Wildcards are expanded in path elements to create a list of folders to be searched for the specified filename mask.  This is done before any recursion is processed if the -r option is given.

When the -r switch is given, each of the folders to be searched is taken as a start point, and recursion occurs into subfolders below each one to search for the specified filename mask.  Recursion will also not occur through Windows 'special folders' such as APPDATA.

If you are in any doubt about which files will be selected, use -q to display a list of files to be deleted.

Examples:

Delete all SENT FS files more than seven days old

DeleteOlder -d7 @FFREQ\sent\*.fs

Delete all MCF and TIF files over 30 days old in any MAIL subfolder of which the foldername has no extension:

DeleteOlder -d30 @FFPO\*.\*.MCF

DeleteOlder -d30 @FFPO\*.\*.TIF

Delete client mail over 30 days old in any USERJOBS mail subfolder where the owner name folder has no extension:

DeleteOlder -r -d30 @FFJOBS\*.\inbox\*.MCF

DeleteOlder -r -d30 @FFJOBS\*.\inbox\*.TIF

Delete all JOB*.TXT files over a year old anywhere under the USERJOBS folder:

DeleteOlder -y1 -r @FFJOBS\JOB*.TXT

Incorrect Example:

Try to delete all files in 'temp' folders below the FAXFACTS folder:

DeleteOlder -m1 -r @FFBASE\TEMP\*.*

The above command will only delete files in @FFBASE\TEMP and for example @FFBASE\TEMP\XXX if they exist, not for example files in @FFBASE\USERJOBS\00001234\TEMP.  Instead use more specific syntax such as:

DeleteOlder -m1 @FFJOBS\*\TEMP\*.* @FFJOBS\*\*\TEMP\*.*