Question: a few weeks ago, we setup a cronjob that wipes the entire contents of /tmp every Sunday at 5am. I wasn't really convinced that this is a good idea. Today we discovered that a certain task depended on an existing directory inside /tmp - the task was broken, and worse, it remained silence about why it failed. The question is:

Is it generally a bad idea to just wipe out /tmp?

Answer: 
According to [the FHS](http://www.pathname.com/fhs/pub/fhs-2.3.html#TMPTEMPORARYFILES):

> 
> Programs must not assume that any files or directories in /tmp are preserved between invocations of the program.
> 
> 
> Rationale
> 
> 
> IEEE standard P1003.2 (POSIX, part 2) makes requirements that are similar to the above section.
> 
> 
> Although data stored in /tmp may be deleted in a site-specific manner, it is recommended that files and directories located in /tmp be deleted whenever the system is booted.
> 
> 
> FHS added this recommendation on the basis of historical precedent and common practice, but did not make it a requirement because system administration is not within the scope of this standard.
> 
> 
> 

However, this is only a recommendation, and furthermore, it states only between invocations of a program -- which unless you're rebooting your server as well at 5am on Sunday, isn't happening. So, things like lockfiles, temp sockets, etc get deleted and cause problems.

As [MadHatter](https://serverfault.com/users/55514/madhatter) suggested, use `tmpwatch`.
My thoughts on this is..

Yes.. dont wipe the /tmp..

Lots of strange and weird applications use the temp for buffering and temporary storage..

If the information wasnt important, it wouldnt store it there :)

Ive seen, logging buffers, webserver sessions and even library versions in there on servers..
Its best that you leave it alone.. unless it needs to be cleaned...

Hope this helps :)