- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How do I find Files older than 4 hours in HP UX11....
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
Forums
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
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
тАО08-18-2008 02:14 AM
тАО08-18-2008 02:14 AM
How do I find Files older than 4 hours in HP UX11.11
I need the following requirement.
In a directory /tmp/test I need to find any files which are not accessed from the last 4 hours. I dont want to delete any files but need to know the Path of that file.
As per me, in HP find command there is no -mmin option like in LINUX. So - mtime/-atime/-ctime will tell me the days old. But not by time (Here 6 hours.
Could someone help me please???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2008 02:32 AM
тАО08-18-2008 02:32 AM
Re: How do I find Files older than 4 hours in HP UX11.11
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2008 02:36 AM
тАО08-18-2008 02:36 AM
Re: How do I find Files older than 4 hours in HP UX11.11
Could you elaborate please....
In /tmp/test I need to find the files which are 4 hours old and need to know the path of the file. I dont want to change the time stamp of the file or I dont want to delete it also.
I just need those File names.(Path)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2008 02:45 AM
тАО08-18-2008 02:45 AM
Re: How do I find Files older than 4 hours in HP UX11.11
Try this
# find /tmp/test ! -atime -4
Regards
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2008 02:49 AM
тАО08-18-2008 02:49 AM
Re: How do I find Files older than 4 hours in HP UX11.11
#perl -MFile::Find -le 'find(sub{print $File::Find::name if -f $_ && -M _ <= 4/24},@ARGV)' /path
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2008 03:19 AM
тАО08-18-2008 03:19 AM
Re: How do I find Files older than 4 hours in HP UX11.11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2008 03:52 AM
тАО08-18-2008 03:52 AM
Re: How do I find Files older than 4 hours in HP UX11.11
Since you are asking for the last *access* timestamp, the correct Perl solution is this:
# perl -MFile::Find -le 'find(sub{print $File::Find::name if -f $_ && -A _ >= 4/24},@ARGV)' /path
You can pass multiple '/path' arguments to the script, The age criteria is based on one day, so 4/24 of one day represents the desired 4-hours. The files returned by the above represent those whose access time equals or *exceeds* 4-hours. That is, they have *not* been recently accessed.
Thus Ahsan's copy-and-paste is incorrect.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2008 06:49 AM
тАО08-18-2008 06:49 AM
Re: How do I find Files older than 4 hours in HP UX11.11
> option like in LINUX.
If you really like the "find" in GNU/Linux,
you could try (building and) using that
"find" on HP-UX. The source code is
available:
http://www.gnu.org/software/findutils/
By the way, "-mmin" is for the _modified_
date-time. "-amin" is for the _accessed_
date-time. You want which one?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2008 07:14 AM
тАО08-18-2008 07:14 AM
Re: How do I find Files older than 4 hours in HP UX11.11
something like this could be useful
# touch -amt 200808181000 /tmp/ref1
# touch -amt 200808181400 /tmp/ref2
# find /opt/mtmc/ibs/import/reject -xdev -type f -newer /tmp/ref1 -a ! -newer /tmp/ref2 -exec rm {} \+
This will remove files that are newer (more recently modified) than 10:00AM AND NOT newer than 2:00 PM. Make sense? You can change the comand as needed to put the output into a file or directory or remove (as above).