防止在运行“tar xzf”时显示时间戳消息

Mar*_*pee 34 tar

运行时tar xzf,如何防止此消息(防止显示时间戳消息):

tar: node: time stamp 2011-06-07 02:02:30 is 8309 s in the future
tar: user/Node: time stamp 2011-06-07 01:56:05 is 7924 s in the future
Run Code Online (Sandbox Code Playgroud)

jas*_*yan 41

tar 可以选择取消此消息 [1]:

-m, --touch
不提取文件修改时间

但是,您可能还应该检查您的系统时钟是否有问题。

[1] http://unixhelp.ed.ac.uk/CGI/man-cgi?tar

  • 这抑制了文件修改时间的提取,而不仅仅是消息。有这种消息是预期的情况(还没有 RTC 时间),但时间戳将被恢复。 (2认同)

小智 28

您可以在保留时间戳的同时抑制警告

tar xzf myarchive.tar --warning=no-timestamp
Run Code Online (Sandbox Code Playgroud)