[ic] Purging session/ and tmp/ - expireall, or rm?
edl at newmediaems.com
Fri Nov 21 08:57:46 EST 2003
At 07:49 AM 11/21/2003 -0700, you wrote:
>>>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 /home/*/catalogs/*
>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) ?
I believe you have it right, and I'm guessing you meant as opposed to all
catalogs on a server being directly under one directory, i.e.:
New Media E.M.S. Technology Solutions for Business
11630 Fair Oaks Blvd., #250 eCommerce | Consulting | Hosting
Fair Oaks, CA 95628 edl at newmediaems.com
(916) 961-0446 http://www.newmediaems.com
(866) 519-4680 Toll-Free (916) 961-0447 Fax
More information about the interchange-users