Find the answer to your Linux question:
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 ...
  1. #1
    Just 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?

  2. #2
    Linux 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:

    Code:
    # cd /var/www/html
    # tar -cf /path/to/tarball .
    That way the directory won't be saved in the tarball.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...