Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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.

share|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
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

Put the following in your user's crontab:

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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