find . -mtime +7 -print # for files older than 7 days.
find . -mtime +7 -exec /bin/rm -rf {} \; 2>/dev/null 1>&2 # to remove files
find /var/log -mtime +60 -type f -exec rm -rf {} \; # for removing files from /var/log which is older than 60 days
No comments:
Post a Comment