Cron to delete files older than X days
On 12Apr2012 17:59, Facundo M. de la Cruz <email@example.com> 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.
Cameron Simpson <firstname.lastname@example.org> DoD#743
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