Re: tmp files dumping



Robert Hull <Robert@xxxxxxxxxxxxxxxxxxxxxxxx> writes:

In comp.os.linux.misc, on Fri 24 March 2006 16:01, Jeremiah DeWitt
Weiner <jdw@xxxxxxxxx> wrote:

CWO4 Dave Mann <misterfixit@xxxxxxxxxxxx> wrote:

Hey Group, I was snooping around my system just now and looked in
the /root/tmp folder. There is stuff in there from months ago. When
does it ever get emptied?

I never heard of a /root/tmp directory (not "folder"), although
there's nothing impossible about it. /tmp is standard; /root/tmp is

All users have tmp directories which are used by some programs to store
temporary stuff. It never gets emptied by the operating system. It is your
stuff (or root's stuff) so it is up to the user to empty it. Now one could
put in a cron job to do so
For example put in an entry into roots crontab which says

0 4 1 1-12/1 * find /root/tmp -mtime +30 rm \{\} \;
which would delete all items older than 30 days old from /root/tmp at 4AM on
the first day of each month.


not. There are about three ways/times in which temp directories get
emptied, other than doing it manually:
1. Never.
2. At reboot.

Almost none of the distros do this. But this is usually with reference to
/tmp not to the individual users tmp directories.


3. When something like 'tmpreaper' gets run on a schedule.

Exactly which of these might apply depends on your distribution.
Personally, I think 'at reboot' is the best way to do it, but
reasonable people can and do disagree.

But some people want to empty /tmp more than every three years

That is what cron is for.

.



Relevant Pages

  • Re: [PHP] Executing shell commands
    ... I tried all of the pre-written functions ... > set apache to run as that user. ... So for instance to reboot the machine, perhaps a cron job would check ...
    (php.general)
  • Re: Disk thrashing, Please HELP!
    ... This showed that up2date called python, ... If upon reboot after that, the thrashing has stopped, you can ... Perhaps it was a cron job that finally finished, ...
    (RedHat)
  • Re: What is removing files from /tmp?
    ... is running tmpwatch or deleting the files. ... present then reboot. ... then perhaps setup a cron job to monitor ... running causing the deletion at the time. ...
    (Fedora)
  • Re: [SLE] RANT: Advantages of Dual Core
    ... Or that your tmp directories are full. ... your point about the log rotate is quite ok. ... cron job to continue, it won't stop my harddisk from filling up, it'll just ... I'm just pointing out the irritating effects, not wether it can or can't be ...
    (SuSE)
  • Re: Booting different OS from cron
    ... JA> I'm trying to figure out if there's a way to run a cron job in FreeBSD ... JA> which will cause it to reboot into a different OS. ... I don't think it can be done with the FreeBSD boot manager, ...
    (comp.unix.bsd.freebsd.misc)