This version uses -type f, so symbolic links are not processed directly; however old directories will remain. You may also use -xdev, -P, -H, etc to limit find's arguments. The issue is that if find is long running a race exists between the file name collection and the execution of rm.
![Linux configtab in tmp c Linux configtab in tmp c](/uploads/1/2/5/4/125445159/660114514.png)
Dec 20, 2012 - Here's my log: hpappy/home/quesada/tmp/julia (master) ♪ l README.md. Linux checking type of operating system we're going to target. Open up a terminal, type llvm-config and use the tab completion to figure.
It is possible to replace an intermediate directory with a symbolic link. Another issue to look out for is weird file names. This version is un-escaped so a file like '-r myfile /' may do bad things. The concept is correct.–Sep 5 '13 at 17:33. You can't just blindly delete everything that hasn't been modified for a certain amount of time.
A lot of programs store sockets in there, which never get modified but are still an integral part of the program working. Take for instance mysql from one of my servers: srwxrwxrwx 1 mysql mysql 0 Sep 11 04:01 mysql.sock=That's a valid, working 'file' in /tmp. It just looks old because mysql hasn't been restarted in a while. Either limit your find with '-type f' or '-atime', or use one of the distro-provided tools others have mentioned. Some linux distros have a package that will clean up old files in /tmp for you.
It isn't hard to implement your own, as mentioned above. One thing to look out for are long running processes, especially 'zombies', which are ones that have died but which haven't finished cleaning up after themselves. If a process has a file open, just deleting it from /tmp won't actually reclaim its space - you have to kill the process or somehow coerce it to close the file. Many programs that write log or temporary files are designed to catch a signal (often SIGUSR1) and close and re-open any log or temporary files for that reason. Many Linux distributions include something named 'tmpwatch', or similar which runs via cron and deletes things on a pre-defined gradient.
Some are smart enough to go by the owner of the file. Stuff that is owned by daemon users gets cleaned out faster than stuff owned by regular users.
![Tmp Tmp](/uploads/1/2/5/4/125445159/963904433.png)
Check on the mailing lists for your distro of choice to find out.Still, you should have SNMP or some other kind of monitor watching how much room is available, if it fills up services like Apache aren't going to be happy. For instance, e-accelerator for PHP will need plenty of room, some mail scanners don't clean up properly, etc.