EnderUNIX Team.

EnderUNIX tips

Mail to My Friend , Home Page

[ Console ]

"Remove files older than 2 days" - Mehmet Uluer - (2006-11-13 10:00:55)   [10545]

muluer ~# find /tmp/ -type f -mtime +1 -fprintf /tmp/files-`date +%m%d%Y`.txt '%t %10k %p \n' -delete 2> /tmp/delerr-`date +%m%d%Y`.txt

look at /tmp/ directory,
find regular files (i.e., not directories or other special files),
modified at least two days ago,
write them to a file (i.e., /tmp/files-11102006.txt),
delete them,
and log the errornous ones to a file (i.e., /tmp/delerr-11102006.txt).

Mail to My Friend , Home Page