Results 1 to 2 of 2
I created a tar of the /var/www/html directory from a live web server and I want to extract it onto another server that will eventually become a backup server to ...
- 03-17-2010 #1Just Joined!
- Join Date
- Jan 2010
- Location
- Tampa, Florida
- Posts
- 3
Help extracting tar onto another server
I created a tar of the /var/www/html directory from a live web server and I want to extract it onto another server that will eventually become a backup server to the live server.
When I extract the tar file, I see the whole directory structure /var/www/html. How do I extract the file just leaving the contents of the html directory in the directory of the new server?
- 03-17-2010 #2Linux Newbie
- Join Date
- Mar 2009
- Posts
- 228
Try to use the '--strip-components 3' option. If your version of tar doesn't support it then you have to create the tarball as follows:
That way the directory won't be saved in the tarball.Code:# cd /var/www/html # tar -cf /path/to/tarball .


Reply With Quote