开发者

pack files on windows and preserve folder timestamps

开发者 https://www.devze.com 2023-02-19 05:42 出处:网络
I want to put a big folder on Windows b开发者_StackOverflow中文版ox into one archive (tar, zip, gzip, whatever). Is there a tool that can preserver all folder timestamps?

I want to put a big folder on Windows b开发者_StackOverflow中文版ox into one archive (tar, zip, gzip, whatever). Is there a tool that can preserver all folder timestamps?

The timestamps have to be preserverd after unpacking the archive on a Linux box.

Any ideas are welcome!


tar will do fine. gzip is for single file compression, zip won't preserve directory timestamps.

EDIT: Sample.

tar jcpf backup.tbz2 thedir
rm -rf thedir
tar jxpf backup.tbz2

Timestamps preserved.

EDIT2:

cygwin tar correctly preserves timestamps. Tested with tar jcf on cygwin, tar jxf on linux.

EDIT3: WinRar preserves directory timestamps, linux unrar restores them properly.


DotNetZip preserves timestamps on folders, as well as files.


It seams that there's no soluation to all my requirements:

  1. Pack on Windows an preserve folder timestamps
  2. Unpack on Linux and preserve original folder timestamps
  3. I prefer a copy/paste aka portable installation of the tool, otherwise the deployment gets to complicated.
  4. A partial, drop in cygwin installation by just copying the necessary exe and dll files works, but doesn't preserve the folder timestamps.
  5. Full cygwin installation is not easily possible since the windows client machines are on terminal server (see http://www.cygwin.com/faq/faq.setup.html#faq.setup.setup-fails-on-ts)
  6. Zip doesn't work because unzip on ubuntu cannot preserver folder timestamps, even if the zip tool of choice does.
0

精彩评论

暂无评论...
验证码 换一张
取 消