Thread: files in /tmp
View Single Post

   
  #3 (permalink)  
Old 02-20-2008, 06:26 PM
Taylor, Grant
 
Posts: n/a
Default Re: files in /tmp

Lew Pitcher wrote:
> You might want to put a command to clean out /tmp into your crontab
> (/etc/cron.daily would be a good place). Such a command could look like
>
> find /tmp -atime +3 -exec rm -f {} \;
>
> which will clean out files that haven't been referenced in 3 or more
> days


I would add the option(s) of "-type f" or "-type d" or "-type f -o -type d" to only remove files / directories / both. I had a similar cron job as above set to 90 days and it was amazing how much like clock work my MySQL server would fail to respond when it's socket was removed from /tmp. Just a heads up.



Grant. . . .
Reply With Quote