Re: Cron to delete files older than X days

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12Apr2012 17:59, Facundo M. de la Cruz <fmdlc@xxxxxxxxxxxxxxxx> wrote:
| You can try with the -ctime option.
| 
| The syntax is ok, but if any process update the file content the mtime
| is updated too. The -ctime options seek for files which the metadata is
| not updapted for X amount of days.

But remember that ctime (last change to inode) is updated on chmod,
chown, file rename etc.

For debug purposes, put a -ls in the find ahead of the "-exec rm". That
way it will recite the file (and mtime) before removal.

And of course, if your cron job removed stuff, it will already be gone
when you come in to look later with your manual find.

Cheers,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

I took that Reading Dynamics course, and it really works.  I read _War and
Peace_ in an hour last night.  It's about Russia.       - W. Allen, ca. 1962

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list


[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux