_Qwerty_ Posted March 18, 2003 Report Share Posted March 18, 2003 Hello! I have made a tarball of about 200 MB, and inside that is the directory /home/user/public_html/gallery/ and the files and subdirectorys that gallery contains. Now i need to replace the local files of my ~/public_html/gallery/* files, how would i do that if the backup tarball is in /mnt/cdrom/backup.tar.gz ?? I have tried to read the manual page for "tar", and i have looked through two diffrent howtos, and from them i have guessed it should be something like this cd /mnt/cdrom tar xzvf backup.tar.gz /home/user/public_html/gallery/* -C ~/public_html/gallery/ but that causes lots of lines stating home/user/public_html/gallery/UPGRADING tar: home/user/public_html/gallery/UPGRADING: Cannot open: No such file or directory and so forth for diffrent files... any tips would be appreciated :) Quote Link to comment Share on other sites More sharing options...
aru Posted March 19, 2003 Report Share Posted March 19, 2003 Hello! I have made a tarball of about 200 MB, and inside that is the directory /home/user/public_html/gallery/ and the files and subdirectorys that gallery contains. Now i need to replace the local files of my ~/public_html/gallery/* files, how would i do that if the backup tarball is in /mnt/cdrom/backup.tar.gz ?? as follows: ~$ cd / ~$ tar xvfz /mnt/cdrom/backup.tar.gz home/user/public_html/gallery the syntax is: tar xvfz "tarball.gz" "file(s) you want to extract"; notice the "cd /" and the relative path to gallery (that is important if the tarball wasn't created with the -P flag) Also notice that, AFAIK, the "file(s) you want to extract" must match the filenames of the files included in the tarball. I mean that must match not only the name of the file, but the full path to it as is in the tarball list; so in case of doubt do a "tar tvfz tarball.gz" to get a list of all the files included in the tarball. HTH Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.