Preserve Timestamps...
 
Notifications
Clear all

Preserve Timestamps when using TAR oder RSYNC  

  RSS
pragomer
(@pragomer)
New Member

Hi,

it seemed to me that this would be a very easy topic - I thought so…

The thing is, we got problems imaging the newer Macbooks (t2-chip, etc.), so to get at least a "logical file dump" I thought about using rsync to a hfsplus usbdrive, or using tar.

To test this workflow I played with tar on my linux workstation.

Thinking of linux/unix timestamps, there are 3 timestamps atime, mtime, ctime.

Now I tried both, rsync and tar with its parameters for preserving the maximum of metadata. I tend more towards tar, so I tried

tar –atime-preserve -cfz archive.tar.gz /myfoldertoarchive

But after extracting the archive via

tar -xpf archive.tar.gz

atime and ctime get the timestamp of extraction time.

Then I realized, that –atime-preserve is for the extracting part, so I tried also

tar –atime-preserve -xpf archive.tar.gz

That didnt work either.

Does anyone have an advice why –atime-preserve does not work for me, and how I could perhaps even preserv ALL 3 timestamps, so also the "ctime" one?

Thank you, also for this forum and the great collaboration.

P.

Quote
Posted : 13/02/2020 6:40 am
athulin
(@athulin)
Community Legend

Does anyone have an advice why –atime-preserve does not work for me, and how I could perhaps even preserv ALL 3 timestamps, so also the "ctime" one?

As noone seems to have answered, …

–atime-preserve preserves atime of source files. It does not cause atime to be included in the tar archive information. It only ensures that once the tar program has finished creating the archive, the atime data of the source files have not been affected by the operation.

Use a tool that was designed for forensic imaging instead.

ReplyQuote
Posted : 28/02/2020 12:40 pm
Share: