1753529 Members
5088 Online
108795 Solutions
New Discussion юеВ

tar command

 
SOLVED
Go to solution
Grace Adedotun
Occasional Advisor

tar command

Helo over there. My name is Grace

We use hp-ux operating system in my organisation and i happen to be the system administrator. My question goes thus:
I backed up the entire system using the following command:

tar -cvf /dev/rmt/0m / ( / indicates the root directory which comprises all other directories). I want to restore a particular diretory (tps) which contains files and as well as directories. I dont know the command to use.

The full path of the directory i want to restore is /bm7test/bmpc/tps. This directory (tps) comtains directories as well as files.

I have used the following commands but did not work.

1. tar -xvf /dev/rmt/0m /bm7test/bmpc/tps
2. tar -xv /dev/rmt/0m /bm7test/bmpc/tps*
3. tar -xvf /dev/rmt/0m /bm7test/bmpc/tps/*
4. tar -xvf /dev/rmt/0m /bm7test/bmpc/tps*.*

I specified a single file from the tps directory and it was restored. This indicates that my tape is okay. I even listed the contents of the tape and it was okay.

I tried the above commands in tps directory as well as other directories but they did not work.

Please i need your help.

Regards


Grace
20 REPLIES 20
Bharat Katkar
Honored Contributor

Re: tar command

Grace,
For taking entire backup you should consider taking it with respect to Volume Groups. Ignite-UX is the best option to backup the root VG whereas fbackup/frecover are the most preffered one for backing up other VG's.

If you take backup of VG00 i.e. root VG it take's care of OS and it's configuration. While Data which normally resides in other VG can be backuped up using fbackup.

For taking backup of VG00 thr' Ignite:
# make_recovery -ACv -d /dev/rmt/0m

This will backup your entire VG00 volume group. Do not use tar for this.

For other VG see man FBACKUP/FRECOVER.

Please let us know if you need any more clarification.
Regards,
You need to know a lot to actually know how little you know
Pnaidu
Frequent Advisor
Solution

Re: tar command

suppose you want to restore in tps directory
tps># tar -xvf /dev/rmt/0m /bm7test/bmpc/tps .

did you specify block size while creating backup? if yes then specify the block size as well.(suppose 64)

e.g. tar -xvfb /dev/rmt/0m 64 /bm7test/bmpc/tps .




Bharat Katkar
Honored Contributor

Re: tar command

Grace,
Check whether Ignite UX is installed on your system, if not you can download the same from the link below..it's free.

For Ignite Administration DOc:
http://docs.hp.com/hpux/onlinedocs/B2355-90837/B2355-90837.html

For Ignite Download:
http://www.software.hp.com/products/IUX/download.html#N100DC

Regards,
You need to know a lot to actually know how little you know
Rodney Hills
Honored Contributor

Re: tar command

Your first restore should have worked.
tar xvf /dev/rmt/0m /bm7test/bmpc/tps

Are any symbolic links involved here?

-- Rod Hills
There be dragons...
Francisco J. Soler
Honored Contributor

Re: tar command

Hi,

a detailing, if you use tar with /dev/rmt/0m as device you can omit the device especification:

To copy:

tar cv files (/dev/rmt/0m is the default device)

To restore:

tar xv files

Frank.
Linux?. Yes, of course.
Grace Adedotun
Occasional Advisor

Re: tar command

Thanks for your reply. I really appreciate it, so quick?

I have answers to the questions

1. The Ignite UX is istalled

2. I did not specify the block size when backing up which means it will use defaulth block size.

The backup did not include system image but the files as listed below as it appears when typing bdf command. I used tar command and not make_recovery command as follows

tar -cvf /dev/rmt/0m /

1. /
2. /home
3. /var
4. /opt
5. /tmp
6. /stand
7. /dailybackup
8. /dailybackup
9. /databackup
10. /bm7live
11. /bm7test

The directory (tps)i want to restore is in /bmtest
and this is the full path /bm7test/bmpc/tps.
This tps contains directories as well as files.

Please help


Grace




Grace Adedotun
Occasional Advisor

Re: tar command

Sorry i forget to tell you that symbolic links are involved. This is the content of the directory (tps) i want to restore as listed from the tape.

______________________________

rwxrwx--- 601/600 0 Mar 16 15:29 2004 /bm7test/bmpc/tps/
rwxrwx--- 601/600 0 Mar 16 15:29 2004 /bm7test/bmpc/tps/admin/
rw-rw---- 602/600 31395 Mar 16 16:33 2004 /bm7test/bmpc/tps/admin/recover.log
rw-rw---- 602/600 211 Mar 16 15:29 2004 /bm7test/bmpc/tps/admin/dmctl.out
rw-rw---- 602/600 2084 Mar 16 15:29 2004 /bm7test/bmpc/tps/admin/tdrun.out
rw-rw---- 602/600 1596 Mar 16 16:33 2004 /bm7test/bmpc/tps/admin/Td.trace
rw-rw---- 602/600 0 Mar 16 15:29 2004 /bm7test/bmpc/tps/admin/bgc010.out
rw-rw---- 602/600 610 Mar 16 19:06 2004 /bm7test/bmpc/tps/admin/Error.File
rwxrwxrwx 601/600 2626 Nov 26 10:13 2003 /bm7test/bmpc/tps/.profile
rw------- 601/600 3550 Jan 9 14:54 2004 /bm7test/bmpc/tps/.sh_history
rwxrwx--- 601/600 0 Jan 7 13:08 2004 /bm7test/bmpc/tps/config/
rwxrwx--- 601/600 24281 Oct 21 11:25 2003 /bm7test/bmpc/tps/config/bankmstr.td.
r7
rwxrwx--- 601/600 26937 Nov 26 19:08 2003 /bm7test/bmpc/tps/config/bankmstr.ddf
rwxrwx--- 601/600 8270 Nov 2 17:53 2003 /bm7test/bmpc/tps/config/bankmstr.cio
.ftb
rwxrwx--- 601/600 7959 Mar 19 19:12 2004 /bm7test/bmpc/tps/config/bankmstr.cio
rwxrwx--- 601/600 20588 Mar 19 19:12 2004 /bm7test/bmpc/tps/config/bankmstr.td
rwxrwx--- 601/600 1685 Oct 21 11:50 2003 /bm7test/bmpc/tps/config/bankmstr.cio
.r7
rwxrwx--- 601/600 20583 Oct 24 09:18 2003 /bm7test/bmpc/tps/config/bankmstr.td.
ftb
rwxrwx--- 601/600 24075 Nov 25 16:57 2003 /bm7test/bmpc/tps/config/bankmstr.td.
test
rwxrwx--- 601/600 6015 Nov 25 16:57 2003 /bm7test/bmpc/tps/config/bankmstr.cio
.test
rwxrwx--- 601/600 6040 Nov 28 13:25 2003 /bm7test/bmpc/tps/config/bankmstr.cio
.good
rwxrwx--- 601/600 24075 Nov 26 16:15 2003 /bm7test/bmpc/tps/config/bankmstr.td.
good
rw-rw---- 601/600 3619 Nov 26 16:25 2003 /bm7test/bmpc/tps/config/txt2
rwxrwx--- 601/600 8299 Jan 6 14:12 2004 /bm7test/bmpc/tps/config/bankmstr.cio
.org
rw-r----- 601/600 8670 Jan 7 12:13 2004 /bm7test/bmpc/tps/config/bankmstr.cio
.mike
rwxrwx--- 601/600 8445 Jan 7 12:26 2004 /bm7test/bmpc/tps/config/bankmstr.cio
.map
rwxrwx--- 602/600 0 Oct 21 11:28 2003 /bm7test/bmpc/tps/bin symbolic link t
o /bm7test/bmpc/bin
rwxrwx--- 602/600 0 Oct 21 11:28 2003 /bm7test/bmpc/tps/messages symbolic l
ink to /bm7test/bmpc/messages
rw-rw---- 602/600 4 Mar 16 15:29 2004 /bm7test/bmpc/tps/DMCTL.pid
rw-rw---- 602/600 4 Mar 16 15:29 2004 /bm7test/bmpc/tps/TDRUN.pid
rw-rw---- 602/600 4 Mar 16 15:29 2004 /bm7test/bmpc/tps/.td.pid
rwxrwx--- 601/600 1928 Oct 22 12:29 2003 /bm7test/bmpc/tps/tpginfo
rwxrwx--- 601/600 1034 Oct 23 12:34 2003 /bm7test/bmpc/tps/tpgstart
rwxrwx--- 601/600 2306 Oct 23 12:35 2003 /bm7test/bmpc/tps/tpgstop
rwxrwx--- 601/600 1614 Nov 25 18:38 2003 /bm7test/bmpc/tps/tpsmenu.sh
rw-rw---- 601/600 3619 Nov 26 16:33 2003 /bm7test/bmpc/tps/txt3

_____________________________________


Regards


Grace
Sundar_7
Honored Contributor

Re: tar command


tar -xvf /dev/rmt/0m /bm7test/bmpc/tps

Tell us what kind of messages you get from the above command ?
Learn What to do ,How to do and more importantly When to do ?
Grace Adedotun
Occasional Advisor

Re: tar command


I dont really get any message. After some minutes atimes, 45 minutes, it will just return back to the prompt # without displaing any error message.

With my little knoweldge the files should be displaying as it is restoring because of v (verbose)option

Thank you


Grace