[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: tar copying problems for "/" to "/mnt"



On Sun, Sep 16, 2001 at 01:08:29PM +0800, Rino Mardo wrote:
...
> partition) to "/mnt" which points to my spare partition.  to do this i
> use tar with the commands:
> 
> cd /; tar cf - / | (cd /mnt; tar xf - )
> 
> this works fine but i get this timestamp messages:
> 
> tar: Archive contains future timestamp 2001-09-16 20:33:45
> 
> so i played around with tar's switches and i've even used the "-p" but
> i the same timestamp message although a different date and time of
> course.
> 
...
tar like this is my personal favorite too, here is my script:

#!/bin/sh
tar clfCS - $1 --atime-preserve --exclude TRANS.TBL . | tar xpfC - $2

I don't recall why I selected each of those options and some may
be quite inappropriate (e.g. excluding TRANS.TBL is for copying
Rock Ridge CDs), but --atime-preserve is a must, or suddenly all
your files will be stamped as accessed today, which confuses
programs like mutt.  S and p are necessary to preserve sparse
files and permissions.  l prevents tar from including /mnt
itself.

The message you are getting probably means that you have a file
on your disk dated into the future, try locating it with
# tar clfCS - / --atime-preserve . | tar tvf 2>&1 | less -j2
then hit
: /future timestamp<enter>
to find the file with the possible error and check its actual
status with
: !stat /path/filename
and check that tar did not throw it away with
: !stat /mnt/path/filename

Anyway, the message should not prevent tar from doing its job.
My personal cure after checking that it is harmless would be
# (tar options | tar options) 2>&1 |
fgrep -v "tar: Archive contains future timestamp"

A more rude trick is to stop all other processes (especially
cron and ntpd), use date to set your clock 5 years into the
future, copy the files and set the clock back.
-- 
This message is hastily written, please ignore any unpleasant wordings,
do not consider it a binding commitment, even if its phrasing may
indicate so. Its contents may be deliberately or accidentally untrue.
Trademarks and other things belong to their owners, if any.



Reply to: