[opensuse] Cleaning /tmp without restarting servers
Hi all, I need to clean the /tmp & /var/tmp and any other tmp directories without having to clean at restart servers (running 24x7). All hints I found are for startup/shutdown time (like http://lists.opensuse.org/archive/opensuse/2007-01/msg01353.html). rm -rf /tmp/* seems a little dangerous for a running system. I saw some perl scripts, but not being a programmer, I am not sure they are dangerous too (like http://lg.wwc.edu/issue20/followup.html and http://lg.wwc.edu/issue20/cleantmp2.0). I also added the 7 day old option to cron (http://lists4.suse.de/opensuse/2007-05/msg02714.html), but nothing seems to be happening. Any suggestions welcome. :-) Al -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
LLLActive@GMX.Net wrote:
I need to clean the /tmp & /var/tmp and any other tmp directories without having to clean at restart servers (running 24x7).
[snip]
Any suggestions welcome.
every 24hours : find /tmp /var/tmp <othertmpdirs> -atime +1 | xargs rm -Rf /Per Jessen, Zürich -- http://www.spamchek.com/ - your spam is our business. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
LLLActive@GMX.Net wrote:
I also added the 7 day old option to cron (http://lists4.suse.de/opensuse/2007-05/msg02714.html), but nothing seems to be happening.
AFAIK, that option is used only at boot time: Did you make sure there actually are files that have not been accessed for a week? Try ls -lu. Moreover, there is another variable, OWNER_TO_KEEP_IN_TMP. Files belonging to users in that list are exempt from deletion. A.
LLLActive@GMX.Net schreef:
Hi all,
I need to clean the /tmp & /var/tmp and any other tmp directories without having to clean at restart servers (running 24x7).
All hints I found are for startup/shutdown time (like http://lists.opensuse.org/archive/opensuse/2007-01/msg01353.html).
rm -rf /tmp/* seems a little dangerous for a running system. I saw some perl scripts, but not being a programmer, I am not sure they are dangerous too (like http://lg.wwc.edu/issue20/followup.html and http://lg.wwc.edu/issue20/cleantmp2.0).
I also added the 7 day old option to cron (http://lists4.suse.de/opensuse/2007-05/msg02714.html), but nothing seems to be happening.
Any suggestions welcome.
:-) Al
yast2>system>/etc/sysconfig editor>system>Cron set the parameters MAX_DAYS_IN_TMP MAX_DAYS_IN_LONG_TMP TMP_DIRS_TO_CLEAR LONG_TMP_DIRS_TO_CLEAR as you see fit. That should do the trick. Regards, -- Jos van Kan registered Linux user #152704 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (4)
-
Ansgar Esztermann
-
Jos van Kan
-
LLLActive@GMX.Net
-
Per Jessen