The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Shortcut for extracting homedir.tar subdirectories

Discussion in 'Data Protection' started by sebby, Dec 21, 2008.

  1. sebby

    sebby Well-Known Member

    Joined:
    Jun 15, 2004
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    Hi everyone,

    Every other day I check the integrity of my account backups at random and uncompress the homedir and mysql directories on a local server at the office to rebuild the sites locally ("tar -xzvf username.tar.gz username/homedir/public_html username/mysql" use to give me the files I needed to do this).

    Starting with WHM 11.24, the homedir is now archived (homedir.tar) and nested in the main tarball. Can anyone suggest a neat command line to extract at once the mysql and public_html directories in this new setup (without the need to uncompress all the rest)?

    I thank you in advance for your suggestions.

    Sebby

    Running CentOS 5.2
     
  2. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    447
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    You may try the following command to extract a specific file from your tar.gz file.

    tar -z --extract --file=yourbackup.tar.gz yourbackup/path/to/folder

    Assuming, you must know the hierarchy and paths of things in the backup before it was compressed.
     
  3. sebby

    sebby Well-Known Member

    Joined:
    Jun 15, 2004
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    Thanks Howard but this is a no go as I want to extract in a single step the public_html directory included in the homedir.tar archive that is nested in the main tarball (username.tar.gz). I am looking for a way to pipe those 2 operations somehow...

    Cheers,

    Sebby
     
  4. jpgauvin

    jpgauvin Registered

    Joined:
    Apr 7, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    I just find out that I have the same problem :mad:

    please if someone know the answer, let me know :confused:

    thanks
     

Share This Page