home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
killold1.zip
/
KILLOLD.DOC
< prev
next >
Wrap
Text File
|
1996-06-11
|
3KB
|
90 lines
***CAUTION*** ***ATTENTION*** ***WARNING***
THIS PROGRAM IS ACTUALLY DESIGNED TO ERASE FILES FROM YOUR SYSTEM ON
A CONTROLLED BASIS. IMPROPER OR CAUSAL USE OF THIS PROGRAM CAN REMOVE
FILES THAT YOU MAY HAVE INTENDED TO KEEP. MAKE SURE YOU KNOW EXACTLY WHAT
YOU ARE DOING WHEN YOU USE THIS PROGRAM.
YOU HAVE BEEN WARNED.
***CAUTION*** ***ATTENTION*** ***WARNING***
This program will delete all files from a directory that are <age> days old.
Format is KILLOLD <directory> <age>
or
KILLOLD <listfile> <age>
where <listfile> contains a list of directories and age.
This is a very straightforward program to delete "old" files from
a directory.
It takes 2 possible parameters: a directory (or listfile) and an "age"
in days old to check for. It will scan the directory and delete any files
older than the specified number of days.
The listfile is simply a shortcut way of running this program against a
lot of directories at one time. It has the same format as the parameters
to the program itself. IE: a directory name and the age in number of days
to check for deletable files. If you supply an age on the command line with
a listfile, then this will be the "default age" for any directories in the
listfile that do not specify an age.
sample invocations:
killold c:\tempfiles 10
would delete any files older than 10 days from the c:\tempfiles directory.
if you had a listfile named c:\delete.lst of the format:
c:\tempfiles 10
c:\oldjunk 21
c:\discardable
c:\outbound 14
The command:
Killold c:\delete.lst 15
would check and delete files older than:
10 days old in the c:\tempfiles directory
21 days old in the c:\oldjunk directory
15 days old in the c:\discardable directory
14 days old in the c:\outbound directory
Requirements:
REXXUTIL.DLL must be installed.
RXDATES.CMD must be in the same directory as KILLOLD.CMD. This is a general
purpose routine I wrote a while ago to handle date conversions and date
manipulations. You might find it useful in itself in any other routines you
write.
POSTLOG is a routine that I use to log activity. You can modify
it however you wish or delete calls to it from the KILLOLD.CMD
program. I find it handy though.
You have the source, so any "bug fixes" are totally up to you. I would
appreciate hearing from you if you do find one or add significant functions
that other users might like to see.
Denis Tonn
Fido 1:153/908
DTONN@VNET.IBM.COM