Purge Old Files Script

Mark Musone mmusone at shatterit.com
Mon Sep 30 11:10:43 EDT 2002


Essentially all you need is something to the effect of:


find / -atime X -type f -exec rm {} \;

Put that in a cron job, and that should be all you need!!

P.s. the atime and x is kinda relative to your needs, when you say
older,
Do you mean not accessed or not modified..etc..check the man on find for
all the options..

-Mark

 

-----Original Message-----
From: owner-nflug at nflug.org [mailto:owner-nflug at nflug.org] On Behalf Of
Justin Bennett
Sent: Monday, September 30, 2002 10:23 AM
To: nflug at nflug.org
Subject: Purge Old Files Script


I'm looking for a script to delete files older than x number of days.
There is an area on our samba server thats rw for everyone, where users
put stuff temporaily for others to get at. It's getting out of control
lots of old stuff. I want to have a script that blows away old stuff. I
supose I could write something, just wondering anyone has something
they'd be willing to share.

Thanks,
Justin

-- 
-------------------------------------------
Justin Bennett
Red Hat (Linux) Certified Engineer
Network Administrator
Dynabrade Inc.
8989 Sheridan Dr
Clarence, NY 14031
716-631-0100 ext 215





More information about the nflug mailing list