Regarding crontab: Why removal of files from /tmp that were not touched for ie. last week from crontab is supposed to be dangerous? I don`t understand. That is why I was asking about find -atime option. You mount /tmp in RAM - thus it vanishes with every reboot. Why crontab is less safe?
I didn`t realize rc.local_shutdown can be used. Maybe explicit existence of this file would be helpfull. However I`m not sure if it is not too early to wipe /tmp during rc.local_shutdown call.
noatime mount and find command
Re: noatime mount and find command
X session and desktop environments store data in /tmp, so it may be a problem to remove them, even if they were not touched for some days (as long as the session is still running). It's for sure no problem to remove the files on shutdown, when no desktop session is running.
Re: noatime mount and find command
OK I understand this. There is @reboot directive in crontab so it might be scheduled there or as it is now: during startup in rc.S.thenktor wrote:X session and desktop environments store data in /tmp, so it may be a problem to remove them, even if they were not touched for some days (as long as the session is still running). It's for sure no problem to remove the files on shutdown, when no desktop session is running.
If someone has small disk and builds many packages with slackbuild then /tmp gets populated very fast and takes much space. In such case total wipe during boot is method of choice, in my opinion.
Re: noatime mount and find command
rc.local_shutdown is probably not the perfect place for such a cleanup either. The problem is that a lot of daemons like dbus, apache, ... are still running at that point.
The perfect point considering time is during the startup directly after all volumes have been mounted rw, but no services especially none which might need /tmp are running or during shutdown before any volume gets mounted and after most services are already terminated.
Nevertheless rc.local_shutdown is the solution more resistent to updates. But editing any of the init scripts is imho for a KNOWLEDGABLE user no big deal either, because he is prompted by dotnew about those changes during an update. So where to actually put that cleanup method is more like a compromise between simplicity and safety.
Still editing the init scripts is a bit like messing with the law of nature. The results can be unpredictable and fatal. For that reason I prefer to discourage wiki articles encouraging users to edit them.
normal users: put it into rc.local_shutdown --> should be pretty safe and is easier when updating
power users are power users and can do whatever they want: put it into rc.S or rc.0 if you want
The perfect point considering time is during the startup directly after all volumes have been mounted rw, but no services especially none which might need /tmp are running or during shutdown before any volume gets mounted and after most services are already terminated.
Nevertheless rc.local_shutdown is the solution more resistent to updates. But editing any of the init scripts is imho for a KNOWLEDGABLE user no big deal either, because he is prompted by dotnew about those changes during an update. So where to actually put that cleanup method is more like a compromise between simplicity and safety.
Still editing the init scripts is a bit like messing with the law of nature. The results can be unpredictable and fatal. For that reason I prefer to discourage wiki articles encouraging users to edit them.
normal users: put it into rc.local_shutdown --> should be pretty safe and is easier when updating
power users are power users and can do whatever they want: put it into rc.S or rc.0 if you want
Re: noatime mount and find command
What about wiki articles that dicourage users to edit them and only to mention the possibility?Shador wrote: For that reason I prefer to discourage wiki articles encouraging users to edit them.
Just kidding, I understand your point but as I said before - sometimes automation of wiping /tmp is needed and someone may want to edit this scripts at his own risk.