You are not logged in.

#1 2009-11-08 19:41:57

LeoSolaris
Member
From: South Carolina
Registered: 2008-03-30
Posts: 354

Discovered undeleted tmp folder with contents from June.... ?

I just found /var/tmp containing a few files that should have been deleted but for some reason where sticking around. One of them was a recorder session from a few months back, another was a folder from KDE when I downloaded it just to check it out. (Had since removed it all), and the last was a pair of files from vi about a .pacnew from laptop.conf from June.

I am a little confused. I thought all of the tmp folders were cleared out at some point in the startup and shutdown process. These tmp files were eating up nearly 1/2 a gig of space on a fairly limited root. Is there any way to prevent this from happening again, or do I just need to make a cron to delete the contents of this folder every couple of weeks?


I keep getting distracted from my webserver project...

huh? oooh...  shiny!

Offline

#2 2009-11-08 20:10:44

vacant
Member
From: downstairs
Registered: 2004-11-05
Posts: 816

Re: Discovered undeleted tmp folder with contents from June.... ?

# grep -R tmp /etc/rc.*
/etc/rc.shutdown:# Write to wtmp file before unmounting
/etc/rc.shutdown:/bin/umount -a -r -t noramfs,notmpfs,nosysfs,noproc -O no_netdev
/etc/rc.sysinit:/bin/mount -n -t tmpfs none /dev -o mode=0755
/etc/rc.sysinit:/bin/rm -rf /tmp/* /tmp/.* &>/dev/null
/etc/rc.sysinit:: > /var/run/utmp
/etc/rc.sysinit:/bin/chmod 0664 /var/run/utmp
/etc/rc.sysinit:/bin/mkdir /tmp/.ICE-unix && /bin/chmod 1777 /tmp/.ICE-unix
/etc/rc.sysinit:/bin/mkdir /tmp/.X11-unix && /bin/chmod 1777 /tmp/.X11-unix
/etc/rc.sysinit:if [ -f "/dev/.udev/tmp-rules--70-persistent-cd.rules" ]; then
/etc/rc.sysinit:        /bin/cat /dev/.udev/tmp-rules--70-persistent-cd.rules >> /etc/udev/rules.d/70-persistent-cd.rules
/etc/rc.sysinit:if [ -f "/dev/.udev/tmp-rules--70-persistent-net.rules" ]; then
/etc/rc.sysinit:        /bin/cat /dev/.udev/tmp-rules--70-persistent-net.rules >> /etc/udev/rules.d/70-persistent-net.rules

A cursory look indicates only:

/etc/rc.sysinit:/bin/rm -rf /tmp/* /tmp/.* &>/dev/null

So /var/tmp does not appear to be cleared at startup. You can add a line to do this to /etc/rc.local if you want.

Offline

#3 2009-11-09 11:09:18

dobedo
Member
From: Belgium
Registered: 2008-10-04
Posts: 113

Re: Discovered undeleted tmp folder with contents from June.... ?

So /var/tmp does not appear to be cleared at startup. You can add a line to do this to /etc/rc.local if you want.

I would not do that.

http://www.pathname.com/fhs/pub/fhs-2.3 … RVEDBETWEE

/var/tmp : Temporary files preserved between system reboots
Purpose
The /var/tmp directory is made available for programs that require temporary files or directories that are preserved between system reboots. Therefore, data stored in /var/tmp is more persistent than data in /tmp.

Files and directories located in /var/tmp must not be deleted when the system is booted. Although data stored in /var/tmp is typically deleted in a site-specific manner, it is recommended that deletions occur at a less frequent interval than /tmp.

It seems better to keep an eye on it than blindly delete it...or delete it at your own risks!

Last edited by dobedo (2009-11-09 11:10:10)

Offline

#4 2009-11-09 21:55:30

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: Discovered undeleted tmp folder with contents from June.... ?

Maybe set a cron job to delete it monthly or something...But seriosuly, on one of my boxes that I have access to now is like 1MB.


neutral

Offline

#5 2009-11-11 03:38:39

LeoSolaris
Member
From: South Carolina
Registered: 2008-03-30
Posts: 354

Re: Discovered undeleted tmp folder with contents from June.... ?

aaahhhh   so that's its purpose, a semi-tmp folder.  I think I'll cron that one for once a month. It doesn't seem to fill very fast on my system, so now that I know what it is for, I can treat it properly.

Thanks guys/gals!


I keep getting distracted from my webserver project...

huh? oooh...  shiny!

Offline

Board footer

Powered by FluxBB