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
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
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
09-03-2002 10:30 PM
09-03-2002 10:30 PM
help me
I want to decide if the last modify time of file A is early 1 hour than file B,what can i do? how can i compare the time of two files?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2002 10:42 PM
09-03-2002 10:42 PM
Re: help me
you need two commands to find out...
man find
--> have a look to the -newer option, remember that you can use a reference file to compare times.
man touch
--> you can use the touch- command to create a file with a time stamp which you need
This should do it for you.
Allways stay on the bright side of life!
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2002 10:47 PM
09-03-2002 10:47 PM
Re: help me
compare them. i could not get any other leads
kaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2002 11:25 PM
09-03-2002 11:25 PM
Re: help me
You could use perl to get the difference in the two dates:
diff=`perl -e '{print ((stat($ARGV[0]))[9]-(stat($ARGV[1]))[9]);}' fileA fileB`
diff will now contain the number of seconds between the mod times of the 2 files.
Rgds, Robin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2002 12:09 AM
09-04-2002 12:09 AM
Re: help me
is the diff in seconds. (one hour is 3600 seconds)
Hmmm,
diff=`perl -le 'print+(-M shift)-(-M shift)' fileA fileB`
prints the diff in days (hours and seconds as fraction of days)
1 hour = 0.0416667 day
Playing dirty:
perl -le '$^T=(stat shift)[9];-M shift()>-.0417 and print "Too old"' fileA fileB