Purge Old Files Script

Jason Parker-Burlingham jasonp at uq.net.au
Tue Oct 1 14:20:15 EDT 2002


"Justin Bennett" <Justin.Bennett at dynabrade.com> writes:

> ok will put something based on this info, thanks everyone who
> replied. I assume the -type f is files, howbout blowing away empty
> directories then?

Why reinvent the wheel?

tmpreaper is what you want; someone else has already done the dirty
work of deciding what is and what is not appropriate to do when search
for, and deleting files like this.  Doing it yourself will only open
you up to mistakes which are potentially *VERY* costly (have you
considered what would happen if the search followed a symlink back to
/etc, for example?).

I imagine tmpreaper is available for most Linux distrubutions (it's
available for Debian users) or can be compiled with little effort,
probably less than it would to cover all bases yourself.

Alternatively, I find a good quota system ensures users either clean
up files on their own, or come to me to explain why they need more
space.

On the gripping hand, you may also want to look into ensuring the
files are backed up somewhere before they are deleted in case a
deletion catches one of your users (and you) by surprise.

Cheers,

jason
-- 
||----|---|------------|--|-------|------|-----------|-#---|-|--|------||
| ``Ooooaah!                                                            |
|   I'm getting so excited about cheese-making I can't stand it!''      |
||--|--------|--------------|----|-------------|------|---------|-----|-|



More information about the nflug mailing list