one*_*ree 2 rhel virtualbox timestamps files
我有一个非常具体且令人费解的问题。
如果我修改(触摸)位于已安装驱动器上的文件,文件的时间戳会显示实际事件发生前一小时的最新修改时间。
我已经检查了我能想象到的所有可能的选项,但一无所获。
以下是有关设置的更多详细信息(它非常复杂)。
所有机器的时钟设置为(几乎)与 'date' 命令显示的时间相同,rh48vb 时钟向前大约 2 分钟
现在,假设我登录到 rh48vb。我可以访问 home 文件夹(物理上位于 rh55 上)和 /build/ 文件夹,物理上位于本地硬盘驱动器上。我有两个名为 test_home 和 test_build 的文件。
这是魔法:
<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
Run Code Online (Sandbox Code Playgroud)
所以
test_home
从rh68或rh55 中查看文件时,时间戳是正确的。test_home
从rh48vb 中查看时,时间戳是文件修改的rh55时间减去一小时。test_build
从rh48vb时间戳查看文件时,是文件修改的rh48vb时间。无论我是time_home
从rh48还是从rh68或rh55 “触摸”都没有关系——结果是一样的。
在这一点上,我已经没有想法了。
您有两台位于两个不同时区的计算机
rh48vb是 UTC 时间(协调世界时又名 GTM)
英国夏令时的rh55 (BST - GMT +1)
虽然两台计算机上的时间相等,但计算机不知道它们在同一时区甚至在同一国家/地区 - 因此,当您从另一台计算机执行某些操作时,时区将始终为 +/- 1 小时,具体取决于您互动的时区。
如果有一台计算机可以更改时区,请将其设置为不能更改的同一台计算机的时区。
归档时间: |
|
查看次数: |
220 次 |
最近记录: |