[ic] Purging session/ and tmp/ - expireall, or rm?
DB
DB at M-and-D.com
Fri Nov 21 07:51:36 EST 2003
> 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/*
>
>
> --
> Mike Heins
> Perusion -- Expert Interchange Consulting http://www.perusion.com/
> phone +1.765.647.1295 <mike at perusion.com>
Holy crap... I guess I needed that. After running that script my disk
usage went from 45% down to 12%... and I think my drive is 60GB !!!
DB
More information about the interchange-users
mailing list