tar restore issues
Hi, I have taken a backup of the following file system (folder).
/usr/CM/HST with this command tar cpfvz /usr/LARGE/BKUP/hst_20140422.tar.gz * Now I want to restore /usr/CM/HST into another redhat server at /usr/CM/HST and overwrite just HST folder and subfolders. When I am trying restore, the restored files are going in different place. Could I get some guidelines how can I restore exactly into /usr/CM/HST and overwrite HST and their sub folders and files Thanks |
to clarify you did this:
Code:
cd /usr/CM/HST Code:
cp /usr/LARGE/BKUP/hst_20140422.tar.gz /usr/CM/HST |
Yes, I tried
cd /usr/CM/HST tar xvf hst_20140422.tar.gz but it restored under /usr/CM/HST/HST I would like to replace /usr/CM/HST from the backup. |
Back out one dir?
Code:
cp /usr/LARGE/BKUP/hst_20140422.tar.gz /usr/CM/ |
Thank you. I tried this one as well. Then it started restored subfolders under /usr/CM. I would like the full HST folder to be copied at /usr/CM.
I tried something like and this might be working: Does this work (can this copy and replace files under HST): cd /usr/CM tar xvfz /usr/LARGE/BKUP//usr/LARGE/BKUP/hst_20140422.tar.gz HST |
First, look in the tar to make sure you are getting the hierarchy the way you think you are.
Code:
tar tvf whatever.tar.gz Code:
tar xvf whatever.tar.gz -C /usr/CM HST |
Thank you very much, is this command for Red Hat.
|
Centos. It's a redhat clone, you should be ok there.
|
I listed the tar contents using $tar tvfz hst_20140422.tar.gz|more
drwxrwxr-x root/cmm 0 2010-06-14 10:59:37 BKUP/ drwxrwxr-x 1027/cmm 0 2010-10-06 09:00:37 cmmGO/ -rw-rw-r-- 1027/cmm 27 2010-10-06 09:00:37 cmmGO/.profile drwxrwxr-x cmm/cmm 0 2007-06-13 11:04:23 DEVC/ -rw-rw-r-- cmm/cmm 1399808 2014-04-09 11:14:08 DEVC/D_USERCONTROL -rw-rw-r-- cmm/cmm 603136 2014-04-09 11:26:12 DEVC/VOC -rw-rw-r-- cmm/cmm 4096 2004-02-18 09:50:51 DEVC/D_VOC drwxrwxr-x cmm/cmm 0 2013-03-06 07:52:00 DEVC/SAVEDLISTS/ -rw-rw-r-- cmm/cmm 203 2002-10-30 15:54:20 DEVC/SAVEDLISTS/HSTRELN$HSFPSTATUS000 -rw-rw-r-- cmm/cmm 126 2002-10-30 15:54:21 DEVC/SAVEDLISTS/HSTRELN$HSFMASTER000 -rw-rw-r-- cmm/cmm 19 2003-12-18 09:38:00 DEVC/SAVEDLISTS/SEL.NOTES1000 -rw-rw-r-- cmm/cmm 12 2003-07-25 10:43:10 DEVC/SAVEDLISTS/$POTAPPR_2000 -rw-rw-r-- cmm/cmm 386 2003-12-16 14:21:25 DEVC/SAVEDLISTS/$WLLOC4000 -rw-rw-r-- cmm/cmm 24 2002-12-04 14:04:07 DEVC/SAVEDLISTS/FORM.PHA22.B000 -rw-rw-r-- cmm/cmm 8 2002-11-04 15:40:21 DEVC/SAVEDLISTS/FORM.PEST12.B000 -rw-rw-r-- cmm/cmm 7 2003-12-10 17:45:28 DEVC/SAVEDLISTS/APL040000 -rw-rw-r-- cmm/cmm 1013 2003-01-09 11:00:11 DEVC/SAVEDLISTS/$POST.GL.5000 The BKUP, cmmGO, DEVC etc are subfolders under /usr/CM/HST If the backup file is at /usr/LARGE/BKUP Should I issue commands like this: cd /usr/LARGE/BKUP tar xvf whatever.tar.gz -C /usr/CM HST Will the above restore files into /usr/CM/HST and overwrite? |
In that case you would do:
Code:
tar xvf whatever.tar.gz -C /usr/CM/HST Uncompress * to /usr/CM/HST My other command would grab a DIRECTORY out of that list you have and uncomress it to a location.. e.g: Code:
tar xvf whatever.tar.gz -C /usr/CM BKUP Hope that helps. If not, if its confusing or just taking too long... you can always uncompress it to 'wherever' and copy its contents to the correct directory with rsync. E.g: Code:
tar xvf whatever.tar.gz -C /tmp/whatever |
All times are GMT -5. The time now is 02:21 PM. |