Quantcast
Channel: FedoraForum.org
Viewing all articles
Browse latest Browse all 36122

clean up TMP files (linux not so good at it)

$
0
0
Fedora 18 now cleans /tmp but has substituted /var/tmp for system work which does not get cleaned ever as far as I can see.


The following one-liner can be put in a root crontab (suggested to run weekly - say Sunday 2am) and/or put in /etc/rc.d/rc.local - whichever suits you (if you boot often, the latter is enough, if you never boot then you need a crontab entry). It removes files and directories over one day old.

/bin/find /tmp /var/tmp -mtime +1 -exec /bin/rm -rf {} \;

Personally as I boot often, it is part of rc - and works VERY well. I use crontab entries for servers that "never" reboot.

Itt is best to use full path names for things root does SO please don't shorten the executable names.

Viewing all articles
Browse latest Browse all 36122

Trending Articles