Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Fedora, CentOS, and would like to get back to Gentoo
Posts: 332
Rep:
Tar: Preserve file creation/modification date
I provide backups for users on my samba server.
1. I make a tarball of the users' directory with xz compression:
tar -cJf abc.tar.xz /abc
2. I split the tarball into 650 meg. volumes:
split -b 650m abc.tar.xz abc_vol
- - - - - - -
When I re-assemble the volumes and unpack tarball, I notice that all files and directories have lost their original creation or modification date. All dates refer to the date and time in which the archive was created.
My users often rely on searching by date to recover specific items accomplished in a chronological order.
How do I preserve the file/directory creation dates when using tar?
Does it require -atime or -mtime parameters?
All recommendations greatly appreciated.
Thank you for your time.
UNIX and Linux do not preserve the creation date/time on files. They only preserve the last access and last modification times.
Code:
man tar
--atime-preserve
don’t change access times on dumped files
Are you restoring from backup often enough for your users to notice or are you being proactive? Being proactive is very good. Frequently restoring from backup often indicates a problem, possibly with user behavior. Backups should be the kind of thing that end users wonder why they are created because they never see the backups being used to restore files.
Last edited by stress_junkie; 05-15-2009 at 12:26 PM.
Distribution: Fedora, CentOS, and would like to get back to Gentoo
Posts: 332
Original Poster
Rep:
Thanks for the quick reply, Mr. Junkie. :-)
It appears there's nothing I can do to preserve creation/modification times other than use the dd command to copy the partition.
The answer to your question is: trying to be proactive in case of the worst. Oh well, can't solve every user's problem.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.