Navigation:  Programs > Command-Line Utilities >

DELETEOLDER

Previous pageReturn to chapter overviewNext page

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.

If the -q option is given, the program first displays a list of the files to be deleted then waits for confirmation.

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 bad-syntax FS files over a month old:

DeleteOlder -m1 @FFREQ\FAIL\*.fsx

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 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\*.*

 


Topic url: http://www.copia.com/support/refmanual/index.html?deleteolder.htm