Search code examples
windowszipgziparchivetar

pack files on windows and preserve folder timestamps


I want to put a big folder on Windows box 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!


Solution

  • 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.