Hi, I have and old tar archive I want to restore. However, I notice that directories from the tar archive are created with the current date and owned by root:root - I'm running tar as root - whereas the files (not directories) are restored with the original permissions, ownerships, and dates. I use "tar -xvzp -f archive.tgz" for restoring. Is that normal? Am I doing something wrong, or was the archive created without ownership information for directories? If it is, as I think, that the tar archive does not have that info, what option, if any, should have been used to create the archive originally? -- Cheers, Carlos Robinson
On Thu, 2004-05-06 at 10:34, Carlos E. R. wrote:
Hi,
I have and old tar archive I want to restore. However, I notice that directories from the tar archive are created with the current date and owned by root:root - I'm running tar as root - whereas the files (not directories) are restored with the original permissions, ownerships, and dates.
I use "tar -xvzp -f archive.tgz" for restoring.
Is that normal? Am I doing something wrong, or was the archive created without ownership information for directories?
If it is, as I think, that the tar archive does not have that info, what option, if any, should have been used to create the archive originally?
-- Cheers, Carlos Robinson
One additional option you may try is: --same-owner although I believe this is a default setting. You may also try using: tar tzvf archive.tgz | less to see the ownership and perms associated with the files. -- Ken Schneider unix user since 1989 linux user since 1994 SuSE user since 1998 (5.2)
The Friday 2004-05-07 at 08:33 -0400, Kenneth Schneider wrote:
If it is, as I think, that the tar archive does not have that info, what option, if any, should have been used to create the archive originally?
One additional option you may try is:
--same-owner
although I believe this is a default setting. You may also try using:
tar tzvf archive.tgz | less
to see the ownership and perms associated with the files.
I have discovered that some of my tar archives do not have permission info for directories, only for files; whereas some other tar archives have the info complete. One of the incomplete tars was made by Yast backup of suse 7.1 or 7.3 For example, when I extract a tree, I get: .../home/ root:root .../home/cer/ root:root (instead of cer:users) .../home/cer/file cer:users .../home/bin/ root:root (instead of cer:users) .../home/bin/script cer:users So, if the original tar did not save the permission information at that time (years ago) there is nothing I can do now to recover them. But I don't understand why some tar archives I did have it and some don't. -- Cheers, Carlos Robinson
I have discovered that some of my tar archives do not have permission info for directories, only for files; whereas some other tar archives have the info complete. One of the incomplete tars was made by Yast backup of suse 7.1 or 7.3
For example, when I extract a tree, I get:
.../home/ root:root .../home/cer/ root:root (instead of cer:users) .../home/cer/file cer:users .../home/bin/ root:root (instead of cer:users) .../home/bin/script cer:users
So, if the original tar did not save the permission information at that time (years ago) there is nothing I can do now to recover them.
But I don't understand why some tar archives I did have it and some don't.
As you said it was some years ago and may have the options used at that time. I have been using tar/dump for many years always used tar cvf <some file or tape drive> <file list> and never had a problem, as far as I can remember with perms/owners not being saved. Some options will muck them up when saving with tar. Ken
participants (3)
-
Carlos E. R.
-
Ken Schneider
-
Kenneth Schneider