- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: To find files 5 hour older
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-15-2008 01:37 AM
тАО12-15-2008 01:37 AM
To find files 5 hour older
I want to find the files generated by oralce as dbf 5 hours older and delete those files.
find /oracle/TCP/saparch/TCParch -name file "*.dbf" -mtime +0 -exec rm '{}' . \; will find 24 hrs older file. But i want to have 5 hours older
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-15-2008 01:58 AM
тАО12-15-2008 01:58 AM
Re: To find files 5 hour older
#perl -MFile::Find -le 'find(sub{print $File::Find::name if -f $_ && -M _ <= 1/24},@ARGV)' /path
modify as per your requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-15-2008 02:04 AM
тАО12-15-2008 02:04 AM
Re: To find files 5 hour older
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1254376
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-15-2008 04:54 AM
тАО12-15-2008 04:54 AM
Re: To find files 5 hour older
Perl will do this. You want files that are "older" (less recently modified) than 5-hours ago and only those that have a ".dbf'" extension, so you need:
# perl -MFile::Find -le 'find(sub{unlink $File::Find::name if -f $_ && -M _ >= 5/24 && $_=~/.+\.dbf/},@ARGV)' /oracle/TCP/saparch/TCParch
Notice that Ahsan's post printed and didn't remove filenames and returned files modified during the last (1) hour --- a cut and paste from another post that didn't solve your problem.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-15-2008 06:48 AM
тАО12-15-2008 06:48 AM
Re: To find files 5 hour older
$ touch -t 200812150000 /tmp/ref1.tmp
$ touch -t 200812150500 /tmp/ref2.tmp
$ find ./ -type f -newer /tmp/ref1.tmp ! -newer /tmp/ref2.tmp -iname \*.dbf -exec rm {} \;
Best regards
Fredrik Eriksson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2008 07:04 AM
тАО12-16-2008 07:04 AM
Re: To find files 5 hour older
-mmin 1740
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2008 07:50 AM
тАО12-16-2008 07:50 AM
Re: To find files 5 hour older
find /oracle/TCP/saparch/TCParch -name file "*.dbf" -mtime +0 -exec rm '{}' . \; will find 24 hrs older file. But i want to have 5 hours older
GNU command
5 Hours
find /oracle/TCP/saparch/TCParch -type f -name "*.dbf" -mmin 300 -exec rm '{}' .\;
29 Hours
find /oracle/TCP/saparch/TCParch -type f -name "*.dbf" -mmin 1740 -exec rm '{}' .\;
http://hpux.cs.utah.edu/hppd/hpux/Gnu/findutils-4.4.0/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2008 07:52 AM
тАО12-16-2008 07:52 AM
Re: To find files 5 hour older
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1296181
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-16-2008 07:52 AM
тАО12-16-2008 07:52 AM
Re: To find files 5 hour older
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2009 11:14 PM
тАО08-18-2009 11:14 PM