LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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

Reply
 
Search this Thread
Old 05-15-2009, 11:44 AM   #1
Sum1
Member
 
Registered: Jul 2007
Distribution: Slackware and Gentoo
Posts: 227

Rep: Reputation: 21
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.
 
Old 05-15-2009, 12:23 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
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.
 
Old 05-15-2009, 03:50 PM   #3
Sum1
Member
 
Registered: Jul 2007
Distribution: Slackware and Gentoo
Posts: 227

Original Poster
Rep: Reputation: 21
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.

Thanks again, your help is greatly appreciated.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get file modification date/time in Bash script cmfarley19 Programming 12 01-19-2013 09:37 AM
file creation date prashantbhushan Linux - General 2 05-29-2007 08:32 AM
Heeelp! How to preserve file date modification attribute Slackovado Slackware 1 03-30-2005 09:36 AM
ls -al file creation date blackzone Linux - Newbie 2 08-23-2004 01:31 AM
File Modification Date Comparison MadTurki Programming 7 03-08-2004 04:02 PM


All times are GMT -5. The time now is 03:17 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration