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.

Trying to extract homedir.tar

Discussion in 'Data Protection' started by fkatzenb, Jan 26, 2010.

  1. fkatzenb

    fkatzenb Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Lusby, Maryland, United States
    cPanel Access Level:
    Root Administrator
    I am trying to find some files that were deleted on one of the accounts from a few weeks ago. I took the backup, acctname.tar.gz, and extracted it. I went to extract the homedir.tar and it won't let me!

    Code:
    root@server [/backup/w02/acctname]# tar xvzf homedir.tar
    
    gzip: stdin: not in gzip format
    tar: Child returned status 1
    tar: Error exit delayed from previous errors
    
     
  2. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    For non-gzip-compressed tar archives please try the following example command (that notably omits the "-z" switch used for gzip-compression):
    Code:
    # tar -xvf homedir.tar
    For additional reference I recommend reviewing the manual "man" documentation using the following command:
    Code:
    # man tar
     
  3. fkatzenb

    fkatzenb Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Lusby, Maryland, United States
    cPanel Access Level:
    Root Administrator
    Wow... don't I feel like an idiot. Thanks! :eek::D
     
  4. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    Yes it's working
     
  5. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    I have extracted using the command
    # tar -xvf homedir.tar

    but the directory homedir is not created


    root@server[/backup/cpbackup/monthly/nilesh/]# cd homedir
    -bash: cd: homedir: No such file or directory
     
  6. 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
    It should have been created. Did you end up with the original homedir.tar file or is it lost as well.
     
  7. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    The command used may have extracted the contents into the same directory from where the command was executed, for example, the directory name matching the cPanel account username.

    What does a directory listing show within the same path?
    Code:
    # ls -ahl /backup/cpbackup/monthly/nilesh
    If the directory "homedir" does not exist, try the following to ensure it is created before proceeding:
    Code:
    # mkdir -pv homedir
    To verify the directory "homedir" exists, use stat:
    Code:
    # stat homedir
    Once you've verified homedir exists, you may then extract the archive contents into the specified directory, as seen below:
    Code:
    # tar -xvf homedir.tar -C homedir
    If there's still difficulty, try using one of the following to just list the contents (without extracting); this should help identify or confirm what is stored and at what directory paths within the archive:
    Code:
    # tar -tvf homedir.tar
     
Loading...

Share This Page