List files not modified for at least 6 days

From: Sabrina Lautier (slautier@amadeus.net)
Date: Wed Jul 28 2004 - 11:19:28 EDT


Dear Admins,

Do you know a way to list files which have not been modified for at least 6
days ?

Actually, what I need to do is to clean once a week a directory (/gctmp)
with files not modified for at least 6 days.

The following commands would be fine:
$ find /gctmp/. -mtime +6 -exec rm {} \;
$ find /gctmp/. -mtime +6 -exec rmdir {} \;
except that I don't want directory /gctmp/locks to be treated.

I started writing the following scripts:
ls /gctmp | egrep -v "^locks$" | while read file
do
  if [[ -d $file ]]
  then
    find /gctmp/$file -mtime +6 -exec rm {} \;
    find /gctmp/$file -mtime +6 -exec rmdir {} \;
  else
    # What for files under /gctmp not modified for at least 6 days ??
  fi
done

But I don't know how to remove files not modified for at least 6 days ?
Any help will be welcome.

Regards,
Sabrina
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:29:10 EDT