LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-17-2015, 05:22 AM   #1
MahendraL
LQ Newbie
 
Registered: Jul 2009
Posts: 22

Rep: Reputation: 0
File time stamp and time as printed by date showing difference


Hi
Please see below actions.

$ touch abcd #abcd does not exist before
$ ls -l abcd
-rw-r--r-- 1 james games 0 Apr 17 15:01 abcd
$ date
Fri Apr 17 15:39:55 IST 2015

Why is there about 38 minutes difference even though I type commands in quick succession ?

Thank you.
 
Old 04-17-2015, 07:19 AM   #2
JeremyBoden
Senior Member
 
Registered: Nov 2011
Distribution: Debian
Posts: 1,128

Rep: Reputation: 232Reputation: 232Reputation: 232
Like this?
Code:
jeremy@hector:~$ touch abcd
jeremy@hector:~$ ls -l abcd
-rw-r--r-- 1 jeremy jeremy 0 Apr 17 13:18 abcd
jeremy@hector:~$ date
Fri 17 Apr 13:18:26 BST 2015
 
Old 04-17-2015, 07:38 AM   #3
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Which filesytem you are using?
 
Old 04-17-2015, 07:57 AM   #4
JeremyBoden
Senior Member
 
Registered: Nov 2011
Distribution: Debian
Posts: 1,128

Rep: Reputation: 232Reputation: 232Reputation: 232
I'm using ext4 on a Mint version of Debian.
 
Old 04-17-2015, 08:00 AM   #5
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
Originally Posted by JeremyBoden View Post
I'm using ext4 on a Mint version of Debian.
I wanted to ask that from OP.
 
Old 04-17-2015, 08:08 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,529

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
Virtualised guest ?.
 
Old 04-18-2015, 12:45 AM   #7
MahendraL
LQ Newbie
 
Registered: Jul 2009
Posts: 22

Original Poster
Rep: Reputation: 0
I found the cause of it. The home directory is getting mounted from another Linux machine X and that machine X has wrong time (behind by 38 minutes)
So the file was getting timestamp from that machine X having wrong time while date command is showing time of current machine Y.
Thanks for your replies.
 
Old 04-18-2015, 06:17 AM   #8
JeremyBoden
Senior Member
 
Registered: Nov 2011
Distribution: Debian
Posts: 1,128

Rep: Reputation: 232Reputation: 232Reputation: 232
On a point of curiosity?

How did /home get mounted by a different machine?
I could understand if you had ssh'd into a machine - but that wouldn't give the behaviour you got.
 
Old 04-18-2015, 11:43 PM   #9
MahendraL
LQ Newbie
 
Registered: Jul 2009
Posts: 22

Original Poster
Rep: Reputation: 0
JeremyBoden,
I had an entry in /etc/fstab file on machine X something like below.
10.20.30.40:/NLMNT/home /home nfs defaults 0 0

So the time on this machine 10.20.30.40 was wrong.
Time on machine X is correct. But
$ touch abcd

is actually creating a file physically resident on machine 10.20.30.40 with that machine's timestamp
while date command shows current time on machine X and they differ.
 
Old 04-19-2015, 05:02 AM   #10
JeremyBoden
Senior Member
 
Registered: Nov 2011
Distribution: Debian
Posts: 1,128

Rep: Reputation: 232Reputation: 232Reputation: 232
Thanks - I didn't think of NFS...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Regarding date-time-stamp problem smarty86 Programming 8 11-04-2009 09:57 PM
Cut out a date/time stamp by using SED and scripting studdard Programming 4 03-01-2009 11:58 AM
How can I append the date/time stamp to commands in history? abefroman Linux - Security 2 05-29-2008 11:21 AM
Rename file based on its own date/time stamp airman99 Linux - General 19 09-05-2006 07:52 AM
Time stamp in Samba is 11 hours behind time stamp in Linux Linh Linux - General 3 09-04-2003 12:44 PM


All times are GMT -5. The time now is 09:04 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration