Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to delete files.

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello,
I like to remove trace files (Oracle) older then 2 weeks,
in a given directory. (/app/oracle/ptyappdb/8.1.7/admin/udump$)
They have the *.trc extension, but there hunderds of them!so is there a unix script to do this daily? I like to run the script manualy.

I use HP-UX 11.11 on HP9000.
 
Use the find command & put it into cron to do it automatically.

E.g.

find /app/oracle/ptyappdb/8.1.7/admin/udump$ -type f -mtime +14 | xargs rm -f to do it manually, or put

15 0 * * * find /app/oracle/ptyappdb/8.1.7/admin/udump$ -type f -mtime +14 | xargs rm -f 2>&1

in root's crontab to delete the files every day at 0:15 TandA

One by one, the penguins steal my sanity.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top