seaeagle Posted January 20, 2007 Report Share Posted January 20, 2007 Hi all - I have tmpwatch installed on my system, and it is supposed to do a daily clean of the /tmp & /var/tmp folders, removing files not accessed in the past 10 days. When I checked the /etc/cron.daily/tmpwatch file, this is how it was configured: #!/bin/sh [ -f /etc/sysconfig/tmpwatch ] && . /etc/sysconfig/tmpwatch /usr/sbin/tmpwatch $TMPWATCH_EXCLUDES 240 /tmp /var/tmp [ -f /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n if [ -d /usr/share/man/$LANG/ ] && [ -d /var/catman/$LANG/ ]; then /usr/sbin/tmpwatch -f 240 /var/catman/{X11R6/cat?,cat?,local/cat?,$LANG/cat?} else /usr/sbin/tmpwatch -f 240 /var/catman/{X11R6/cat?,cat?,local/cat?} fi I notice that it has "$TMPWATCH_EXCLUDES" before "240 /tmp /var/tmp" - does that mean it is set by default not to work on those 2 folders? As they are the ones I do want to regularly clean, along with my /home/seaeagle/tmp folder, should I change that line to: /usr/sbin/tmpwatch 240 /tmp /var/tmp /home/seaeagle/tmp I just want to make sure I have things right. Thanks. Quote Link to comment Share on other sites More sharing options...
Mhn Posted January 20, 2007 Report Share Posted January 20, 2007 $TMPWATCH_EXCLUDES is a variable which i think should be set in /etc/sysconfig/tmpwatch Take a look there after a line: TMPWATCH_EXCLUDES = something Quote Link to comment Share on other sites More sharing options...
seaeagle Posted January 20, 2007 Author Report Share Posted January 20, 2007 Thanks for your quick reply Mhn. It looks like a list of sub-directories that tmpwatch should ignore (such as /tmp/.ICE-unix). I've left the $TMPWATCH_EXCLUDES in the cron file & just added my home tmp directory to the end of the line. Quote Link to comment Share on other sites More sharing options...
pindakoe Posted January 21, 2007 Report Share Posted January 21, 2007 You may want to add --all to also purge otehr objects than files, directories & symlinks (sockets etc). Secondly I have found that some programs access files (I suspect updatedb), meaning that files never get deleted as their access times (by which tmpwatch works) are continuously updated. I usethe --ctime option. See man tmpwatch for details. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.