1833776 Members
1956 Online
110063 Solutions
New Discussion

Pax command help

 
SOLVED
Go to solution
Kris_5
Occasional Advisor

Pax command help

I am trying to extract a tar file using pax command and I need to retain the timestamp on the files.

pax -pe -rv <$t_tar_file

The tar file is generated on a Unix host which is situated in west coast of US. When I extracted the tar file on a Unix host which is situated in Europe (a time zone difference of 9hrs) the creation time of the file is changed to creation time at source + 9hrs (time zone difference).
Example file in source
------------------------
drwxrwsr-x 2 apps dev 96 Aug 14 17:10 rk3124

Example file in target
------------------------
drwxrwxr-x 2 apps dev 96 Aug 15 02:10 rk3124


Could some body help how to avoid the change in time stamp on the file in target machine. Thanks in adv.

3 REPLIES 3
Jordan Bean
Honored Contributor
Solution

Re: Pax command help


The time is preserved, and is correctly interpreted by the target machine. It's supposed to work this way.

Patrick Wallek
Honored Contributor

Re: Pax command help

To see the time stamp as it is for US Pacific time zone, you would have to set the time zone for your session.

# export TZ=PST8CDT

Then do an 'll' and you should see the time stamps match.
Bill Hassell
Honored Contributor

Re: Pax command help

HP-UX only keeps one time: GMT (aka, Zulu or UTC) and tar saves the timestamps in that time. When you list or restore the files, the timestamp is interpreted based on the current setting for TZ. So no matter where you restore the files, the timestamp is correct based on the location where they were saved. This is why users all over the world can login to an HP-UX system and with their TZ set to the local timezone, all date stamps will be correct for the local timezone.


Bill Hassell, sysadmin