Thursday 3 September 2009

TIP:How to restore absolute path backup into different directory

Guys

It is a common day job of a Unix Admin to take backups and restore. However , very often a unix admin stuck due to the fact that he has taken an absolute path backup through tar command and now he wants to restore it into a different directory.

How you can do it. Here is a small but fantastic tip which worked many times for me


Let say, suppose you receive a tar tape created using absolute path names:

tar -cvf /dev/rmt0 /test/*

but now you want to restore it to the /test1 directory. There is a wonderful command named as pax. Syntax for pax command for that purpose would be as follows:

pax -rf /dev/rmt0 -s/test1/test/p


and you are done. Whole backup will be restored in test1 directory. Infact -s switch with pax command did magic for us and allow us this path change.

No comments:

Post a Comment

 How to Enable Graphical Mode on Red Hat 7 he recommended way to enable graphical mode on RHEL  V7 is to install first following packages # ...