That was quick. Thanks!
Quote:
Originally Posted by
frank_rizzo
use the -p option when you extract it.
This does not seem to work though. See below an example where 2 files (with different atimes) are archived and extracted somewhere else. The last line of output shows that the atime was not preserved.
$ ls -lt origin/b*
-rw-r--r-- 1 dsilt2 dsilt2 4 2008-12-15 03:52 origin/bla2
-rw-r--r-- 1 dsilt2 dsilt2 4 2007-07-07 22:22 origin/bla1
$ ls -ltu origin/b*
-rw-r--r-- 1 dsilt2 dsilt2 4 2008-12-15 03:52 origin/bla2
-rw-r--r-- 1 dsilt2 dsilt2 4 2007-07-07 22:22 origin/bla1
$ cd origin/
$ tar --atime-preserve -cvpf archive.tar *
bla1
bla2
$ mv archive.tar ../destination/
$ cd ../destination/
$ tar xvpf archive.tar
bla1
bla2
$ ls -lt b*
-rw-r--r-- 1 dsilt2 dsilt2 4 2008-12-15 03:52 bla2
-rw-r--r-- 1 dsilt2 dsilt2 4 2007-07-07 22:22 bla1
$ ls -ltu b*
-rw-r--r-- 1 dsilt2 dsilt2 4 2008-12-15 04:01 bla1
-rw-r--r-- 1 dsilt2 dsilt2 4 2008-12-15 04:01 bla2