LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 02-13-2006, 01:59 PM   #1
carlbrans
LQ Newbie
 
Registered: Sep 2004
Posts: 2

Rep: Reputation: 0
tar and directory timestamps


I want to tar -cf then tar -xf to recover a directory with the orginal
timestamps on subdirectories. I get "... cannot use utime.." error message in the tar -xf procedure, and directories are recovered, but with new timestamps. I want the original ones. Individual file timestamps are recovered, however.
I should have said that I am using SUSE 10 but it is running under VMWare box which is under Windows XP, using NTFS. A Windows person said that this NTFS will not allow copy preserving directory timestamps, so maybe this is inherited by the Linux system??

Last edited by carlbrans; 02-13-2006 at 02:13 PM.
 
Old 02-13-2006, 04:17 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
I don't think that has anything to do with the "underlying" NTFS,
VMWare doesn't use NTFS structures but operates on an image-file
that is (internally) file-system agnostic to its host.

tar actually preserves time-stamps by default. This may fail if
you're extracting to a file-system that's not Linux-native.


Cheers,
Tink
 
Old 02-13-2006, 04:28 PM   #3
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
When I try it here by creating the archive with:
Code:
tar --atime-preserve -cf
And then extracting the archive with:
Code:
tar -xpvf
The date timestamps (shown with ls -ld) on the extracted directories are the same as those on the original directories. Do I have the wrong timestamp?
 
Old 02-13-2006, 04:38 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Eh?

I don't understand the purpose of your question:
Code:
--atime-preserve
means that the last-access time
on the original won't be modified when you're archiving it.

ls -ld outputs the c(m)time by default.


Cheers,
Tink
 
Old 02-13-2006, 05:28 PM   #5
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
A better way to word my question might have been - was the time that was being preserved the same time that was being reported in the listing? Since one is atime and the other ctime, the answer is no - I was reading the wrong timestamp.
 
  


Reply



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
How Can I tar This Directory? Xian Linux - General 4 06-17-2005 06:32 PM
tar help - how to tar to a different directory thick_guy_9 Linux - Software 2 03-10-2005 04:35 PM
tar a directory kbeaver Linux - General 4 09-12-2003 11:00 AM
Can I tar a directory structure.... shelby Linux - General 9 02-20-2003 09:17 AM
tar a directory radnix Linux - General 5 09-08-2002 08:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:51 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration