I often stick temporary files that I'm working on in /tmp, so I don't have to delete them once I'm done. However, if the computer crashes, then I'm out of luck, because that directory will be wiped.
Is there a way to prevent /tmp being wiped if the computer is restarting from a crash? If not, is there another solution, such as creating another temporary directory elsewhere and have it automatically deleted on restart if there is no crash.
/etc/default/rcS
and changing$TMPTIME
to 1. Thank you anyway! – Sparhawk Dec 29 '12 at 09:46tmpreaper
. Another option would be to put the files into/var/tmp
, which does not get wiped on boot, then clean it out regularly withtmpreaper
. – Sparhawk Dec 29 '12 at 09:53/etc/default/rcS
to scan/proc/cmdline
to look for atmptime=N
parameter and setTMPTIME
accordingly. Now if I need to keep this work on boot, I simple set the boot optiontmptime=2
say. OK, I still loose non-auotsaved stuff in RAM, but at least this problem is solved. – TerryE Oct 27 '13 at 10:43