3

I have a very specific and a very puzzling problem.

If I modify (touch) file located on mounted drive the file's timestamp shows the latest modification time as exactly one hour before the actual event.

I have checked all possible options I could imagine, but got nowhere.

Here are more details about setup (it is quite complicated).

  1. The machine runs RH 6.8 (let us call it rh68).
  2. On top of it I run RH 4.8 on virtual box (let us call it rh48vb)
  3. Physically, home folder is located on machine with RH 5.5 (rh55) and is mounted on both rh68 & rh48vb

All machines' clock set to (almost) the same time as shown by 'date' command with rh48vb clock going about 2 minutes forward

Now, assume I am log on to rh48vb. I have access to home folder (physically located on rh55) and to the /build/ folder, physically located on the local hard drive. I have 2 files named test_home and test_build.

Here is the magic:

<rh48vb>cd /build
/build
<rh48vb>date
Mon Jun  5 13:26:52 UTC 2017
<rh48vb>touch test_build
<rh48vb>ll test_build
-rw-r--r-- users 5 Jun  5 13:26 test_build
<rh48vb>cd ~
<rh48vb>date
Mon Jun  5 13:27:04 UTC 2017
<rh48vb>touch test_home
<rh48vb>ll test_home
-rw-r--r--  1 users 5 Jun  5 12:25 test_home

< ....... login to my physical workstation rh68 ........>
<rh68>date
Mon Jun  5 13:25:36 BST 2017
<rh68>ll test_home 
-rw-r--r-- 1 users 5 Jun  5 13:25 test_home

< ....... login to machine rh55 where homefolder physically is located ........>
<rh55> date
Mon Jun  5 13:25:54 BST 2017
<rh55>ll test_home 
-rw-r--r-- 1 users 5 Jun  5 13:25 test_home

So

  • When I look at file test_home from rh68 or rh55 timestamp is correct.
  • When I look at test_home from rh48vb the timestamp is rh55 time of file's modification minus one hour.
  • When I look at file test_build from rh48vb timestamp is rh48vb time of file modification.

It does not matter if I 'touch' time_home from rh48 or from rh68 or rh55 -- the result is the same.

At this point I have run out of ideas.

3
  • 2
    The rh48vb is running on UTC and the rh68 on BST timezone. You should set them both to the same BST timezone and maybe install the ntp service to sync the machine time with the internet. (UTC offset to BST is +1 hour)
    – Michael D.
    Commented Jun 5, 2017 at 12:54
  • Yes, hwclock -r shows the same time on rh48vb and rh55. I do not have access rights to run hwclock -r on rh68. Commented Jun 5, 2017 at 12:58
  • @michael-d Aha! Thanks a million! If you make your comment an answer I shall upvote and mark it correspondingly. Commented Jun 5, 2017 at 13:07

1 Answer 1

6

You have two computers in two different timezones

  • rh48vb is in UTC time (Universal Time Coordinated aka GTM)

  • rh55 in British Summer Time (BST - GMT +1)

While the time on both computers are equal, the computers don't know that they are in the same timezone or even in the same country - so when ever you do something from to another computer the timezone will always be +/- 1 hour depending from which timezone you interact.

If there is one computer in which you can change the timezone, set it to the same computer's timezone where you can't.

3
  • 1
    Sorry, cannot upvote -- not high enough reputation. Marked it as a correct answer, though. Many thanks again. Commented Jun 5, 2017 at 13:16
  • Or if it's just about viewing the files, just set the timezone for the user accounts (export TZ=Europe/London, or whatever). This is how I deal with machines physically located in different timezones - the hardware clock runs UTC, the default system time is the local timezone, and I have my account set to use my own preferred timezone. (Just need to mind those crontab entries...) Commented Jun 5, 2017 at 13:33
  • The times on the two computers are not equal, actually, and that's the problem. When it's 13:27 UTC on rh48vb, it's 12:25 UTC on rh68. The problem is not the timezone setting, it's the clock setting. This may have been because the time was initially set by entering it in the wrong timezone, but it can't be solved by displaying the time in a different timezone. Commented Jun 6, 2017 at 23:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .