Preventing /tmp from being cleaned on reboot

Posted by Steve on Mon 24 Jan 2005 at 16:00

Debian machines are normally setup so that the /tmp partition, or directory, is emptied as part of the boot process.

I remember this biting me the first time I upgraded to Debian from RedHat 4.2, I copied all the things I wished to keep from the old installation into the small /tmp partition and then did the install. By the time my machine rebooted into Debian all my files were gone!

If you wish to change this behaviour you need to edit the file /etc/default/rcS.

The setting to change is called TMPTIME, and it defaults to 0 meaning all files are removed.

To delete all files older than a week set it to 7, and to keep all files just set it to a rediculously large value such as 9125 - for preserving files less than 25 years old!


This article can be found online at the Debian Administration website at the following bookmarkable URL:

This article is copyright 2005 Steve - please ask for permission to republish or translate.