[PLUG] help with a bash script?

Russ Gilman-Hunt gilmanhunt at comcast.net
Tue Jul 22 19:16:01 UTC 2003


Good evening.
I'm using a bash script I believe I modified from one posted here to clean 
out our FTP directory every night.  I have a bunch of non-technical users who 
need to place (for instance) 50 MB files on an FTP location, and they'll 
forget to remove it later.  So I cobbled this script up (from one that was 
posted to the plug list) to delete files older than one day (so files posted 
on Monday would be deleted Tuesday Night.)

this is the script:

#!/bin/bash
/usr/bin/find /var/ftp/pub/ -type d -mtime +1 -print0 | xargs -0 /bin/rm -rf
/usr/bin/find /var/ftp/incoming/ -type d -mtime +1 -print0 | xargs -0 \
	 /bin/rm -rf


Yes, pretty simple stuff.
It works - mostly. It would work perfectly if it didn't truncate the 
directories; it removes the pub/ and the /incoming directories. 

How would I go about fixing it? 





More information about the PLUG mailing list