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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command to find/delete files in hours

Status
Not open for further replies.

marrow

Technical User
Jul 20, 2001
425
US
find -mtime works on days and after "DAY +1" we can delete files, is there any comand that does the same in hours? I don't think there is, probably have to write a script, any ideas?
 
Not in vanilla find, but gnu find offers the -amin, -cmin and -mmin options to specify minutes since accessed, status changed or modified. HTH.
 
Sorry - should clarify that by 'vanilla' I mean to Solaris 8. It's feasible that 9 and/or 10 will have this functionality. Perhaps someone could confirm?
 
Thanks for your help Ken. KHz also thanks, will try the -newer option when we get a chance, in the meantime we use a cron/script that does the job.
 
Specifically:
Code:
# touch -t 04100905 testfile
# find . -newer testfile
 
Thanks kHz....

I had a problem with Oracle Archive Logs the other night that the newer would have solved most of the headaches....

A large Import / Delete was just filling it up......
 
Hi Kozlow, the -newer might well have solved your problem - were you moving the logs elsewhere or deleting them? The latter strategy is a little dangerous if you come to need them for a restore. Have you considered compressing or gzipping the archive files on a regular basis - this works for us. Post back if you need help with that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top