/tmp filling up
I did my usual df -h and I saw that my system had grown 1.2 G from its former happy size over the past week. WTF!?
I cruised around until I found 1.2G worth of stuff on /tmp. I was in a good mood, so I blasted all of it. Luckily, the system still comes up fine. How are you guys managing /tmp? I have logrotate working fine (FYI for new guys, you have to force it once to set the dates or it won't ever work) and so that part is under control. Thanks, Randux |
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...
|
It's a desktop dev machine. Which "couple lines" did you add?
Can you just do a rm -r /tmp/* Or did you have another trick? Thanks, Rand |
yeah, i just added a couple rm commands (one for hidden files/dirs), like:
Code:
echo "Clearing /tmp ..." |
If you use tmpfs for /tmp then it automatically is cleared on reboot. Is there a reason you don't have it setup like that?
|
Quote:
|
I do similarly to win32sux for the desktop, on the server I delete all files not accessed for 7 days
|
Quote:
could you show us what the commands look like?? you run them using cron, right?? EDIT: i was just thinking and i figured perhaps you're doing something like this (i'm not sure): Code:
find /tmp -atime 7 -exec rm -f {} \; |
Yeah, though I'm not sure if you had a structure like
/tmp /tmp/foo /tmp/foo/bar.txt 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 Code:
find /tmp -regex '^/tmp/.*' -atime +6 | sort -r \ For reference, on the workstation in rc.shutdown (arch) I have Code:
rm -rf /tmp && mkdir -m0777 /tmp |
hey thanks for that script man!! it's very useful stuff!!
question about your rc.0/rc.shutdown line: why no sticky bit?? just curious... question #2: my server's filesystems (reiserfs v3) get mounted with the "noatime" option... does that make the find by atime not doable?? Code:
/dev/hda1 / reiserfs defaults,noatime 0 0 |
Quote:
Quote:
|
cool! thanks! :)
|
Thanks guys, I'll look into this. I hadn't changed anything from the vanilla 10.2 install.
Regards, Randux |
|
Thanks, I think the vanilla rm * will work for my setup.
|
All times are GMT -5. The time now is 07:11 AM. |