Operating System - HP-UX
1834149 Members
2255 Online
110064 Solutions
New Discussion

Re: taking full backup and restoring using tar and cpio

 
khilari
Regular Advisor

taking full backup and restoring using tar and cpio

Hi guys, how would u take a full backup using tar and cpio. COMMANDS FOR BACCKING UP AND RESTORING WILL BE APPRECIATED.
thanks
5 REPLIES 5
Ivan Ferreira
Honored Contributor

Re: taking full backup and restoring using tar and cpio

I think that these commands are not too good for full backup and restore.

For example:

Because of industry standards and interoperability goals, tar does not support the archival of files of size 8GB or larger or files that have user/group IDs 2MB or greater.

And cpio nees to do a find to get the list of files.

What about using fbackup?
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Torsten.
Acclaimed Contributor

Re: taking full backup and restoring using tar and cpio

Hi,

what do you would like to backup?

For the OS you should use ignite:
http://docs.hp.com/en/IUX
(in fact this is tar)

For data it really depends ...

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
khilari
Regular Advisor

Re: taking full backup and restoring using tar and cpio

well, i am working on SCO unix, an old machine we r stuck on and i need to upgrade the software, but have to take a full backup before doing so. thats why thought of using tar or cpio. the disk space is not that big either........
A. Clay Stephenson
Acclaimed Contributor

Re: taking full backup and restoring using tar and cpio

In that case, cpio is a reasonable choice. NOTE: Do not use absolute paths or you can only (without difficulty) restore to exactly the same locations.

I would do something close to this:

cd /
find . -print | cpio -ocv -C 65536 > /dev/stape0 (or what ever your tape drive is)

To restore everything under ./home,
cd to desired starting directory
cpio -icvdum -C 65536 ./home < /dev/stape0

Now if the machine is completely dead, you will need to install an OS before tar or cpio can do you any good.
If it ain't broke, I can fix that.
Rasheed Tamton
Honored Contributor

Re: taking full backup and restoring using tar and cpio

for tar

tape -s rewind (rewind the tape)
tape -a 512 setblk /dev/rStp0
(set the block size to 512)
tar -xvf /dev/rStp0 /*
tar -tvf /dev/rStp0
tar -cvf /dev/rStp0
--
cd /
find . -depth -print |cpio -ocva -C 10240 -O /dev/rct0
cpio -icvd -I /dev/rct0

find . -depth -print | cpio -ocvB -O /dev/nrStp0
cpio -icvdumA < /dev/nrStp0

cpio -itv -I /dev/nrStp0 (to list the contents of the tape

The above is from my old notes and right now I am not able to test it on an OpenServer box - mine is also off the network and away from us. As Clay suggested cpio is more better to use.

Regards.