LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   File time stamp and time as printed by date showing difference (https://www.linuxquestions.org/questions/linux-newbie-8/file-time-stamp-and-time-as-printed-by-date-showing-difference-4175539975/)

MahendraL 04-17-2015 05:22 AM

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.

JeremyBoden 04-17-2015 07:19 AM

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


veerain 04-17-2015 07:38 AM

Which filesytem you are using?

JeremyBoden 04-17-2015 07:57 AM

I'm using ext4 on a Mint version of Debian.

veerain 04-17-2015 08:00 AM

Quote:

Originally Posted by JeremyBoden (Post 5348839)
I'm using ext4 on a Mint version of Debian.

I wanted to ask that from OP.

syg00 04-17-2015 08:08 AM

Virtualised guest ?.

MahendraL 04-18-2015 12:45 AM

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.

JeremyBoden 04-18-2015 06:17 AM

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.

MahendraL 04-18-2015 11:43 PM

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.

JeremyBoden 04-19-2015 05:02 AM

Thanks - I didn't think of NFS...:doh:


All times are GMT -5. The time now is 08:12 AM.