[ic] Purging session/ and tmp/ - expireall, or rm?

Ed LaFrance edl at newmediaems.com
Fri Nov 21 08:57:46 EST 2003


At 07:49 AM 11/21/2003 -0700, you wrote:
>DB wrote:
>
>>>I use a very simple little script I call clean_session_tmp to do it:
>>>
>>>#!/bin/sh
>>>
>>>for DIR in $*
>>>do
>>>         for i in session tmp
>>>         do
>>>             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
>>>             else
>>>                 echo "$0: $DIR/$i doesn't exist."
>>>             fi
>>>         done
>>>done
>>>
>>>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) ?
>Barry

Barry -

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.: 
/var/lib/interchange/?

- Ed


===============================================================
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 mailing list