Results 1 to 3 of 3
Hi,
I have this script running every night:
cd /home/ftp/
find ! -path '*source*' ! -perm 600 -mtime +15 -type f -exec rm -rfv {} \;
find . -empty -type ...
- 12-21-2007 #1Just Joined!
- Join Date
- Dec 2007
- Posts
- 2
Delete untouched file with some extra parameters
Hi,
I have this script running every night:
cd /home/ftp/
find ! -path '*source*' ! -perm 600 -mtime +15 -type f -exec rm -rfv {} \;
find . -empty -type d -exec rm -rfv {} \;
exit
The script enters the /home/ftp/ folder and suppose to delete files that were untouched for more than 15 days and then delete empty folders.
For some reason the script deletes all files created today. This behavior started two weeks ago.
Thanks
- 12-22-2007 #2Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,044
Shouldn't you be using -atime?
What changed two weeks ago to trigger the behaviour?
- 12-23-2007 #3Just Joined!
- Join Date
- Dec 2007
- Posts
- 2
My mistake, I don't need to delete untouched files.
The script should delete files that where upload to this FTP folder and are more than 15 days old.
Thanks


Reply With Quote