36

When running tar xzf, how to prevent this message (Prevent showing time stamp message):

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
  • 5
    Fix your system clock and timezone. Try NTP. – Juliano Jun 07 '11 at 01:55
  • 5
    The system clock and timezone on our destination server is correct. The source files we received were from someone in a much earlier timezone - and additionally some of the files had a timestamp 200 years in the future. – user12345 Jun 27 '14 at 18:49

2 Answers2

40

tar has an option to suppress this message [1]:

-m, --touch
don't extract file modified time

However, you should probably also check that you don't have an issue with your system clock.

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

jasonwryan
  • 73,126
  • 3
    This supresses extraction of the file modified time, not just the message. There are situation when this message is expected (no RTC time yet), but the time stamps shall be restored. – Zrin Nov 17 '14 at 10:26
35

You can suppress the warnings while preserving the timestamps:

tar xzf myarchive.tar --warning=no-timestamp
  • This answer should be accepted. However, it should be noted that this is a GNU tar option. From what I can tell, this isn't supported by busybox (https://github.com/brgl/busybox/blob/master/archival/tar.c), and I don't know what versions/options are available under Mac, etc. . – SensorSmith Feb 18 '24 at 00:06