Find delete old files

#  Delete files older than 15 minutes
find /ORA_DISK/redoarch/ -name 'arch_*.dbf' -mmin +15 -delete

#Delete files older than 2 days
50 8 * * * find /ORA_DISK/redoarch/ -name 'arch_*.dbf' -mtime +2 -delete

Old versions of unix find do not have the -delete option, so instead:

#  Delete files older than 15 minutes
find /ORA_DISK/redoarch/ -name 'arch_*.dbf' -mmin +15 -exec rm {} \;

#Delete files older than 2 days
50 8 * * * find /ORA_DISK/redoarch/ -name 'arch_*.dbf' -mtime +2 -exec rm {} \;
Posted in Linux, Rman, Scripts

Leave a Reply

Your email address will not be published. Required fields are marked *

*