Results 1 to 7 of 7

Thread: Extracting a single file from the full backups

  1. #1
    Member
    Join Date
    Oct 2005
    Posts
    45

    Default Extracting a single file from the full backups

    I am trying to extract a single file from a WHM Full Backup tar. I know the filename I need to extract, and the directorys to reach the file, but it does not seem to be working.

    Here is what I tried (so I assuming the backup files have a differant directory struture.

    tar xvf yadayada.tar /home/userfolder/forums/Themes/babylon index.template.php
    It chugs for a while (its a 5.3 gb tar) and says it cant find the file specificed.

    Any help would be greatly apprisheated

    Z

  2. #2
    Member adept2003's Avatar
    Join Date
    Aug 2003
    Location
    ~ "/(extra|special)/data"
    Posts
    283

    Default

    tar xvf yadayada.tar /home/userfolder/forums/Themes/babylon index.template.php
    tar -xvf yadayada.tar /home/userfolder/public_html/forums/Themes/babylon/index.template.php

    If that doesn't work, you should probably double-check the location of the file within the archive:
    tar -tvf yadayada.tar
    Chad
    Adept Hosting Ltd
    UK Web Hosting

  3. #3
    Member
    Join Date
    Oct 2005
    Posts
    45

    Default

    Quote Originally Posted by adept2003 View Post
    tar -xvf yadayada.tar /home/userfolder/public_html/forums/Themes/babylon/index.template.php

    If that doesn't work, you should probably double-check the location of the file within the archive:
    tar -tvf yadayada.tar
    Sorry about that, I did have the public_html part in there. however, using that tar listing command (thanks) I have noticed that the backup has added a /homedir/ to the directory structure.
    so I did

    tar -xvf promose7.tar /home/promose7/homedir/public_html/forums/Themes/babylon/index.template.php

    And it still compains about not being able to find the file. I am trying this command from the /backup/daily directory logged in as root. Am I missing "period" or am I not supposed to have the leading "/" or something, or is the backup just stored weirdly and I am not able to extract 1 file out and have to do an entire restore (or just untar the whole damn mess). I would hate to do either (its a 5gb backup)

    Z

  4. #4
    Member adept2003's Avatar
    Join Date
    Aug 2003
    Location
    ~ "/(extra|special)/data"
    Posts
    283

    Default

    Get rid of the leading forward-slash.

    Check the location of the specific file: tar -tvf yadayada.tar | grep index.template.php (assuming you don't have hundreds of files named the same!)
    Chad
    Adept Hosting Ltd
    UK Web Hosting

  5. #5
    Member
    Join Date
    Oct 2004
    Posts
    18

    Default

    it should be :
    Code:
    tar -xvf yadayada.tar userfolder/homedir/public_html/forums/Themes/babylon/index.template.php
    But be careful this will be extracted in your current dir (CWD) i.e.

    if you're in root dir executing this You will find a dir called promose7 and the rest under it

  6. #6
    Member
    Join Date
    Oct 2005
    Posts
    45

    Default

    Quote Originally Posted by nazmy View Post
    it should be :
    Code:
    tar -xvf yadayada.tar userfolder/homedir/public_html/forums/Themes/babylon/index.template.php
    But be careful this will be extracted in your current dir (CWD) i.e.

    if you're in root dir executing this You will find a dir called promose7 and the rest under it
    Thanks! That did the trick. It was because I was includeing /home/ in front of the user's folder.

    Proper santax is: tar -xvf {userfolder}/homedir/{entirepathtofile}

    Z


    p.s. thanks to everyone else that pitched in a comment as well!

  7. #7
    Member
    Join Date
    Mar 2003
    Posts
    93

    Default

    can you extra per directory? if so, how do you do it?

Similar Threads

  1. Extracting cPanel Backups
    By Blessing in forum New User Questions
    Replies: 4
    Last Post: 08-28-2010, 07:42 PM
  2. File Manager problem extracting files
    By mkmagu in forum New User Questions
    Replies: 3
    Last Post: 03-15-2010, 07:55 AM
  3. Extracting emails from CPanel Backups
    By CJC Digital in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 01-10-2010, 03:25 PM
  4. bug in file manager when extracting files?
    By weetabix in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 08-05-2008, 10:57 AM
  5. "Restore Backups" AND Restore a "Full Backup/cpmove file"
    By protocol in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 06-28-2005, 02:53 AM