Extracting a single file from the full backups

ZeusChicago

Active Member
Oct 9, 2005
44
0
156
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
 

adept2003

Well-Known Member
Aug 11, 2003
283
0
166
~ "/(extra|special)/data"
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
 

ZeusChicago

Active Member
Oct 9, 2005
44
0
156
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
 

nazmy

Member
Oct 31, 2004
16
0
151
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
 

ZeusChicago

Active Member
Oct 9, 2005
44
0
156
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!