1863013 Members
2042 Online
110446 Solutions
New Discussion

Re: cpio -x

 
Fred Martin_1
Valued Contributor

cpio -x

Has the -x option always been available for cpio, or is this new with ver.11?

I have always used cpio for my daily backups but noticed some time ago that it didn't do so well with special files.

Today I was reading man on cpio and noticed the -x option.

Does anyone know if it covers -all- special files? i.e. can I completely restore a system with a full cpio (assuming there's enough of an OS left to run cpio for the restore)?
11 REPLIES 11
Steven E. Protter
Exalted Contributor

Re: cpio -x

the -x option was in the cpio released as part of HP-UX 11.00. I just checked a system and I don't think I updated cpio since install.

The only way I know to completely restore a system including lif and boot is Ignite. Though it appears that cpio can fix a partially damaged system. If the LIF area is trashed your only option is to restore off a make_tape_recovery tape.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Stanimir
Trusted Contributor

Re: cpio -x

Yes, really "cpio -x" is restore all dev-files. But it is not good idea, I thing, to
make full copy of your system doing cpio.
As was mentioned above, use Ignite.
Meantime you could use cpio -x for
backup /dev, for example, or for moving data
between disks.
Uday_S_Ankolekar
Honored Contributor

Re: cpio -x

-x option is available in 10.20 , 11, and 11i.
per man pages it does take backup of special files but I think ignite tape(make_tape_recovery) would be better choise.

-USA..
Good Luck..
Leif Halvarsson_2
Honored Contributor

Re: cpio -x

Hi,
The -x option in cpio is very old (at least 10 years I think).

I have often, with earlier versions of HP-UX, cloned system disks with cpio. I have not tried with HP-UX 11.x (as Ignite is a better tool) but I don.t think there is any differences, all special files is created.
Fred Martin_1
Valued Contributor

Re: cpio -x

Thanks folks. I'm reading the fbackup man now - will probably do an ignite tape every two or three months, with fbackup as the daily/weekly routine.

I've only about 30 GB of data and one DLT tape drive - no library - so mine is a simple case.
Fred Martin_1
Valued Contributor

Re: cpio -x

I'm reading man frecover. It appears that it's intended to recover whole directory trees. Can the "include" be a list of specific filenames, not directory names?
Steven E. Protter
Exalted Contributor

Re: cpio -x

Fred,

You are not in my opinion planning on running Ignite often enough.

I run this script to back up vg00 and enable me to restore boot disk without hitting data once a week.

#!/usr/bin/sh
/opt/ignite/bin/make_tape_recovery -Av -x inc_entire=vg00

I also run it prior to almost any patch installation so I have a way of backing out the changes fast should the system not boot after the installation.

My DR strategy is this: Regular make_tape_recovery backups, weekly fbackups and nightly Veritas backups on critical data. Weekly full backups followed by incrementals.

The recovery strategy is if the system is trashed, restore off Ignite tape first and then restore the rest of the data from fbackup or Veritas.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Bernhard Mueller
Honored Contributor

Re: cpio -x

Fred,

regarding your last question: yes with -i you can include individual files, as well as directories which is more common.

Regards,
Bernhard
Bernhard Mueller
Honored Contributor

Re: cpio -x

fbackup and cpio are both safe tools to cover special files.
Fred Martin_1
Valued Contributor

Re: cpio -x

Well, cpio -x skips sockets.
Massimo Bianchi
Honored Contributor

Re: cpio -x

I do not see the necessity to backup a socket. They are temp files, so skipping them is only correct, from my point of view.

And fo a direct answer, the best way of restoring special files, in the need, is:

- ignite, if there was a total crash
- by hand, using a paper copy of an ioscan -fn
- re-creating when possible, using insf.

As previously said, cpio in not a disaster-recovery tool (like ignite) nor a full backup solution by otself.

Massimo