Friday, October 12, 2012

How is the /tmp directory cleaned up?


The directory is cleared by default at every boot, because TMPTIME is 0 by default.
Here you can change the time in the following file:
/etc/default/rcS
TMPTIME says how frequent the tmp dir sould be cleared in days

The default setting that tells your system to clear /tmp at reboot is held in the /etc/default/rcS file. The value we’ll look at is TMPTIME.
The current value of TMPTIME=0 says delete files at reboot despite the age of the file. Changing this value to a different (positive) number will change the number of days a file can survive in /tmp.
TMPTIME=7
This setting would allow files to stay in /tmp until they are a week old, and then delete them on the next reboot. A negative number (TMPTIME=-1) tells the system to never delete anything in /tmp. This is probably not something you want, but is available.
ref : http://askubuntu.com/questions/20783/how-is-the-tmp-directory-cleaned-up

No comments:

Post a Comment