I'd like to make a folder in my GNU/Linux home directory that behaves somewhat like TMPDIR (usually /tmp or /var/tmp); that is, a folder that deletes its contents on reboot or after they've started gathering cobwebs. What's the best way to go about this?

Note that I do not want to simply move the tmp dir to home.

link|improve this question
feedback

2 Answers

up vote 6 down vote accepted

It doesn't "delete on reboot"; it only exists in RAM in the first place. Mount tmpfs to a directory under your home directory.

link|improve this answer
Is there supposed to be a tmpfs file in /dev? There's not one on my system. Or have I misunderstood? – Cameron Jul 1 '11 at 3:35
2  
tmpfs is a virtual filesystem, just like proc or sysfs. You can use the name directly without specifying a device file. – Ignacio Vazquez-Abrams Jul 1 '11 at 3:36
feedback

Put the following in your user's crontab:

@reboot rm -rf /home/user/path/*
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.