[techtalk] Looking for a script
Conor Daly
conor.daly at oceanfree.net
Fri Jun 15 23:38:33 EST 2001
On Fri, Jun 15, 2001 at 07:45:37AM -0700 or so it is rumoured hereabouts,
Keith Barringer thought:
> Some time ago I posted a question here regarding FTP
> servers. From that I picked out ProFTPd and it has
> been doing a wonderful job ever since.
>
> The system has a limited hard drive area and I am
> looking for a script/program that I could run to
> delete files after they have been on the box for a
> length of time. The easier to configure, the better
> and I only need it to run on the subdirectories of the
> FTP folder.
>
The easiest one is a script run by cron.daily (ie once per day) to delete
anything X days old (Doing the first-time delete of anything older than
X days is left as an exercise for the reader). Goes like this:
find $FTP_ROOT (-ctime | -atime) $X -exec rm [-f] {} \;
In fact, you could put that directly in your crontab assuming you
substitute actual values for $FTP_ROOT and $X
Conor
--
Conor Daly <conor.daly at oceanfree.net>
Domestic Sysadmin :-)
---------------------
Faenor.cod.ie
11:34pm up 23:51, 0 users, load average: 0.08, 0.02, 0.01
Hobbiton.cod.ie
11:34pm up 23:52, 1 user, load average: 0.00, 0.00, 0.00
More information about the Techtalk
mailing list