8

I tried the -X switch on zip, but that did not save the date created attribute. I can get it using this method. When a file is added to a zip archive using 7-Zip, it preserves the date created and date accessed attributes. I would like to do the same on Linux and then extract my files on Windows, while preserving the date created.

  • 1
    If possible, change your filesystem for backup system – PersianGulf Sep 1 '13 at 21:54
  • Have you tried using 7-zip? It is not a Windows-specific program. Also, does your filesystem keep a record of the date created? Many do not. – terdon Sep 1 '13 at 22:06
  • It's typically called 7z in unix. – slm Sep 1 '13 at 22:09
  • I'm not sure I'd expect anything from the -X switch either. I think it's to include/exclude the extended attributes related to ACL. – slm Sep 1 '13 at 22:10
  • 1
    @slm also, as far as I know, ext filesystems do not store the creation date, only the modification data so this might not be possible if the files are coming from ext. – terdon Sep 1 '13 at 22:33
1

You could safe the times in a separate file:

(cd /path/to/ntfs/fs && getfattr -n system.ntfs_times -R .) > times

And to restore the times:

(cd /path/to/ntfs/fs && setfattr --recover=-) < times
  • Sounds perfect! I'll try it next chance I get. – NobleUplift Oct 8 '13 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.