SlackwareThis Forum is for the discussion of Slackware Linux.
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 /tmp contents on my PC get cleared upon proper reboot/shutdown - i added a couple lines to /etc/rc.d/rc.0 in order for that to happen... of course on a server this wouldn't be the right approach...
Yeah, though I'm not sure if you had a structure like
and bar.txt was accessed or edited if /tmp and /tmp/foo would be marked as accessed, so I also do a check for if a file is a directory
find /tmp -regex '^/tmp/.*' -atime +6 | sort -r \
| while read file; do
if [ -d "$file" ]; then
rmdir --ignore-fail-on-non-empty "$file"
rm -f "$file"
The regex means that the dir /tmp will never be deleted, otherwise if it hasn't been accessed for 7 days and it was empty it would be deleted. Of course that would fail if the search path '/tmp' had a trailing slash. Also 6 instead of 7 because find ignores fractional days.
For reference, on the workstation in rc.shutdown (arch) I have
question about your rc.0/rc.shutdown line: why no sticky bit?? just curious...
I think that may be a side affect of trying to do an install at 3 in the morning and keep saying to myself: "If I can just get to point X, then I'll be happy and go to bed". I've never picked up on it since. However I've changed it now, thanks for pointing it out.
Originally Posted by win32sux
question #2: my server's filesystems (reiserfs v3) get mounted with the "noatime" option... does that make the find by atime not doable??
From what I understand no, two solutions spring to mind though. Either use the last modified property (mtime I think), or better IMHO (which is what I do) have /tmp on a separate partition and don't use noatime for that partition