Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
The better way to do it is to make it a cron job. I think that cron has a daily script(/etc/cron.daily) that monitors the /tmp directory and deletes things as necessary. Of course, your systems setup could be different so you may not have anything like that.
I do believe that Slackware already does this in its boot up scripts already. At least for some of the older releases, haven't checked 9.0 yet. Check your startup scripts as it might already remove everything in your /tmp folder at boot time.
i dont agree, you shouldnt delete things from tmp in multi user mode as you dont know what people/programs have put there and you could be deleteing important stuff. the fhs states that /tmp is not required to survive a reboot so emptying the contents at boot is a perfectly good time to do it, but do it before all your daemons start up. i think the best solution is to mount /tmp as tmpfs and thus it resides in ram and gets cleared every reboot but this is not a good idea if you dont have a lot of memory.