                CleanDir V 1.0  (c) 1996 Darrell Esau


What is CleanDir?

CleanDir was developed to take care of the "cleanup" process of a temporary
volume on a network server.  I'm not sure what other uses CleanDir could be
of.  The main function of CleanDir is to clean out the "dead wood" on a drive
or directory.  Here's how it works:
CleanDir goes through the directory specified and counts up a number of points
depending on file size, and file date.  The older the file, the more the
points.  Likewise, the bigger the file the more points it will receive.  Of
course you can set the amount of points each gives.  The default is 1 point
per 10K in file size, and 2 points per day.  If the file acquires enough
points, it will be deleted.  The default amount of points required for
deletion is 500, but you can specific that as well.
There is also a switch to make sure any file over a certain size will be
deleted, and any file over a specified amount of days will be deleted.  This
is useful for those really huge files created 2 or 3 days ago, or those pesky
25 byte files created 3 years ago.

CleanDir will also recurse through subdirectories and check the files
contained therein, if so desired.  Also, you can turn on a switch to delete
the subdirectories if they are empty after processing.  Again, this is useful
on a temporary volume of a server.

There is also an option to record a log file to keep track of deleted files
and directories.

If you're not sure what to set the number of points to at first, I'd suggest
running the program with the -NODEL and -LOG switches turned on.  This will
suppress all deleting and record a log file, so you can see what would have
been deleted if it were run without the -NODEL switch.

So which files will be excluded?
None.  If you've got a file you want to be excluded from the deleting, just
set the attribute on it to 'read only'.

Switches:
 -p#  Number of points required to delete a file.  Default: 500
 -ps# Number of points added for each 10K block in file size.  Default: 1
 -pd# Number of points added for each day old in file data.  Default: 2
 -r   Recurse subdirectories.
 -e   Delete empty subdirectories.
 -dDAYS  Delete any file older than the specified number of days.
      (DAYS is a number of days.  i.e. 30 = 1 month.
 -sSIZE  Delete any file larger than the specified size.
      (SIZE is in bytes i.e. 2000000 = 2 Megs.
 -log    Creates a log of all qualifying files to CLEANDIR.LOG.
 -nodel  Suppress all deleting.  (Useful for creating sample logs.)


Examples:

   CleanDir c:\temp -p350 -ps3 -pd1 -r

     This would run CleanDir on the c:\temp directory.  The points required
     to delete a file is set to 350, the points per 10K block is set to 3,
     and the points acquires per day is set to 1.  Also, CleanDir will recurse
     subdirectories with this setting.
        
   CleanDir g:\ -p600 -ps0 -pd4 -r -e -d60

     This configuration would set the points required for deletion to 600,
     set no points per day, and 4 points per day.  Also, any file older
     than 60 days will be deleted.  Recursion with removal of empty
     subdirectories is turned on.  This setting would be useful if you didn't
     care how big files were, but old ones would be deleted.

   CleanDir f:\ -s500 -log -nodel

     With this setting, a log file will be recorded, no deleting will take
     place, and the program will use 500 points for the points required for
     deletion.  This setting would be good to test what the outcome would be
     before actually running the deletion.


Any questions, you can email me at: desau@toocool.itslab.calpoly.edu
   

CleanDir is Shareware, please feel free to distribute and evaluate for a 30 day period.  If you 
would like to register, please send $10.00 US currency to:

Darrell Esau
805 Boysen #13
San Luis Obispo, CA  93405

Educational facilities need not register, though I am interested in where this utility will be
used.  Feel free to send email to the above email address informing me of usage.

Thank you for using CleanDir!

Copyright Notice:

You are free to copy this file (cleandir.zip containing cleandir.exe,
and cleandir.txt) for personal use, or to make it available for
redistribution in its electronic format, provided that:

(1) it remains wholly unedited and unmodified,

(2) no fee or compensation is charged for copies of or access to this
    file (cleandir.zip containing cleandir.exe and cleandir.txt),
    and

(3) this copyright notice and the following disclaimer remain attached


Disclaimer:
This file is provided by the author "as is", and any express or implied
warranties, including, but not limited to, the implied warranties of
merchantability and fitness for a particular purpose are disclaimed.  In
absolutely no event shall the author be liable for any direct, indirect,
incidental, special, exemplary, or consequential damages (including, but
not limited to, procurement of substitute goods or services; loss of
use, data, or profits; or business interruption) however caused and on
any theory of liability, whether in contract, strict liability, or tort
(including negligence or otherwise) arising in any way out of the use of
the information herein contained, even if advised of the possibility of
such damage.







