Date scripting

Sam Varshavchik mrsam at courier-mta.com
Fri Mar 24 03:03:06 UTC 2006


Chris Norman writes:

> Hi people,
> I need to check files to see how old they are.
> 
> How can I do this from within a backup script?
> 
> I need to see if they are over a month old, and if so delete them. How do I 
> get they're last modified stamp please?

find $DIRECTORY -mtime +30 -exec rm -f '{}' \;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20060323/facdd649/attachment-0001.sig>


More information about the fedora-list mailing list