LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 11-26-2007, 02:26 PM   #1
ajatiti
Member
 
Registered: Jun 2007
Posts: 45

Rep: Reputation: 15
Checking Timestamps on RHEL4


Hi,

I have RHEL4. I want to check the timestamp of the files and then compare with the system time, if it's same then OK otherwise error.

Could anybody please give me the command or a script to execute this?

Thanks,
Aj
 
Old 12-01-2007, 05:55 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Using epoch time you could
Code:
test `stat -c %Y /etc/mtab` -ne `date +%s` && echo error
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tar and directory timestamps carlbrans Linux - Software 4 02-13-2006 05:28 PM
How do I insert timestamps in bash? spiffytech Linux - Software 5 01-27-2006 04:00 AM
VSFTPD and file timestamps t3___ Linux - Newbie 4 01-21-2004 02:26 PM
squid timestamps chamkila Linux - General 1 05-08-2003 08:59 AM
Timestamps Config Programming 2 04-22-2002 02:07 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 04:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration