|
There is no way in Unix to get a files creation time. You can find a files modification time, mtime, (you have ctime - the time when a files status was changed - check out the find man page), and if you can guarantee the file has not been modified since it was created, you have your creation time.
Anyway, the -regex looks to be an overcomplication.
find / ! -name "*.log" -mtime 45 | xargs shred -fuvz
If this doesn't work, chances are the files would have been modified after creation.
EDIT; if running this as root, and some important system files were modified 45 days ago, you are staring into the eyes of doom with a command like that.
Do a
find / ! -name "*.log" -mtime 45 -print
to see the output before adding the "destructive" pipe through to xargs shred.
Cheers
ZB
Last edited by zazzybob; 06-13-2005 at 10:34 AM..
|