Find the answer to your Linux question:
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 ...
  1. #1
    Just 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

  2. #2
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    Shouldn't you be using -atime?

    What changed two weeks ago to trigger the behaviour?

  3. #3
    Just 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...