[ale] cleaning out /tmp

Jeff Lightner jlightner at water.com
Mon Sep 3 11:35:25 EDT 2007


You'd still require a script to clean out /tmp on reboot.  However, if
the only purpose of the reboot was to clean out /tmp then I'd suggest it
would be better to create a cron job that just does the clean out.

There was a time when Sysadmins regularly rebooted servers because it
does have some benefit (cleaning up stray memory bits etc...) but it
really is not a required regular maintenance task these days.
(Especially if you've trained everyone to do progressive kills using
"kill -9" ONLY as a last resort.)

One reason NOT to do regular reboots is the perception it causes many
uninformed types that UNIX/Linux is "unstable" and "requires" such
regular reboots.  This is simply not true but I've run into many a PHB
that had that idea in their head.   

Once upon a time I worked with a team lead (who IMO was very smart in
all other things) that required us to reboot all system every weekend
AND run fsck on all the filesystems manually.   Even on those UFS
filesystems this seemed like a needless exercise to me.

By the way - such /tmp cleanout - I did say to check lsof or fuser - if
you were doing a cron with system up I'd also suggest you not delete any
file that had been updated on the present day - some programs create
files then "close" them and later "open" them for other purposes.

-----Original Message-----
From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of
Michael B. Trausch
Sent: Monday, September 03, 2007 11:24 AM
To: Atlanta Linux Enthusiasts
Subject: Re: [ale] cleaning out /tmp

Jeff Lightner, on 09/03/2007 10:31 AM said:
> lost+found is used by journaled filesystems as a location to store
those
> files it couldn't completely identify by (fully qualified path) name
> during a "full" fsck.  It dumps them in there with numeric names so
that
> you can examine them and decide whether you want to keep them.   (Sort
> of like the old chkdisk CHK0000# files you'd get sometimes after
running
> DOS' chkdisk.)
> 
> Since it is /tmp and you intend to delete all the files on a reboot
> anyway there's no real benefit to having it there - on the flip side
> since it takes a single inode and few bytes (when empty) there seems
to
> be no real reason not to leave it alone.
> 
> By the way - if you did cron a clean out rather than only have it
happen
> on reboots you'd want to insure that the clean out script was only
> deleting files not currently "open" by some process.  Running fuser or
> lsof against the files you intend to delete before doing so to be sure
> they're not open would be a good idea in such a script.
> 

Isn't this why some places simply have cron reboot their server once per
week or something like that?

	-- Mike

-- 
Michael B. Trausch               Internet Mail & Jabber: mike at trausch.us
Phone:  (404) 592-5746 x1                         http://www.trausch.us/
Mobile: (678) 522-7934             VoIP: 6453 at sip.trausch.us, 861384 at fwd
Pidgin 2.1.1 and plugins for Ubuntu Feisty! http://www.trausch.us/pidgin



More information about the Ale mailing list