[ic] Purging session/ and tmp/ - expireall, or rm?
Barry Treahy, Jr.
Treahy at MMaz.com
Fri Nov 21 07:49:19 EST 2003
>> I use a very simple little script I call clean_session_tmp to do it:
>> for DIR in $*
>> for i in session tmp
>> if test -d $DIR/$i then
>> find $DIR/$i -type f -mmin +480 | xargs
>> --no-run-if-empty rm
>> find $DIR/$i -type d -empty -depth -mindepth 1 |
>> xargs --no-run-if-empty rmdir
>> echo "$0: $DIR/$i doesn't exist."
>> The 480 is 8 hours. You can change the number to what you want.
>> It is called in cron:
>> 22 4 * * * /usr/local/interchange/bin/clean_session_tmp
The example 'path' above, since this is in 'user' space, can presume that what you are actually targeting are the files in the session and tmp subdirectories (ie CATROOT/session and CATROOT/tmp) ?
Barry Treahy, Jr E-mail: Treahy at MMaz.com
Midwest Microwave Phone: 480/314-1320
Vice President & CIO FAX: 480/661-7028
More information about the interchange-users