Operating System - HP-UX
1851453 Members
3167 Online
104059 Solutions
New Discussion

Re: Tape backup question.

 
SOLVED
Go to solution
Gulam Mohiuddin
Regular Advisor

Tape backup question.

Hi all,

I would like to evaluate following commands:

find /u*/*/psoft/*.{dbf,ctl} -depth -print |cpio -pvumod |compress |remsh rpludb02 > /dev/rmt/c2t1d0BESTn

find /u*/*/psoft/*.{dbf,ctl} -depth |cpio -pvumod |compress |remsh rpludb02 dd of=/dev/rmt/c2t1d0BESTn

1. What are the difference in both commands, will both work?

2. How to check what files have been backed up on tape (Backed up by above command sequences).

3. How to idividually restore a single file.

4. What will happen if the files size are more than 6GB each?

Thanks,

Gulam.
Everyday Learning.
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: Tape backup question.

Couple of issues:

As Bill said to a similar case yesterday, this is a dump and run operation on a remote tape drive. You get no reutnr codes and have no way to verify whether the backup is any good or not.

The command difference is the last part where one redirects to a device, which you hope is there and ohe other uses dd and an output file.

Both will probably work, but you need to test it.

To restore a single file you'd need to cpio the files to a temporary directory and then choose and copy the file you want.

If the file sizes exceed cpio's limit which is probably 8 GB if you have all the patches in, the command will fail.

You probably won't know that it failed unless you look at the output, because this methodology doesn't let you interact and take return codes from the tape drive.

Recommendations:
1) install secure shell openssh. Use that instead of remesh. Stop transmitting your root password clear text across your network

2) Use scp(rcp equivalent) to copy the files to a temporary directy on the machine with the tape drive.

3) Use ssh(remesh equivalent) to run a batch job on the machine with the tape drive. Make sure that job checks return codes on the operation and lets someone know if a non-zero return code comes back.

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
Chris Vail
Honored Contributor

Re: Tape backup question.

Following up Steve's post: use tar instead of cpio, and create a tarball on the local host. Then gzip or compress it, then use scp to copy it to the remote host. Finally use tar or cpio (whichever is your favorite) to copy it off to tape. Then remove the tarballs on the local and remote hosts. This builds a fairly safe, secure and small copy on tape. Retoring it is easy:
compress -u tarballfilename|tar xvf - filename
This lets you restore a single file from the tarball.


Chris
TwoProc
Honored Contributor
Solution

Re: Tape backup question.

The only difference I see between the two is that the -print flag is missing. No big deal on most Unix variants that I'm familiar with - only very old and outdated Unix varieties require the -print flag - HPUX doesn't.
Also, you're using the "-p" flag in there, and that's only for a destination being a directory - not a stream. So - I don't see how either command will work. I think your cpio should be "cpio -oBdvmux " instead.

check the files...
remsh rpludb02 "dd if=/dev/rmt/c2t11doBESTn" | cpio -iBtv

read back a single file
remsh rpludb02 "dd if=/dev/rmt/c2t11doBESTn" | cpio -iBvmuxc "/data1/dfiles/mydfile.dat"

or a bunch of files from that dir...
remsh rpludb02 "dd if=/dev/rmt/c2t11doBESTn" | cpio -iBvmuxc "/data1/dfiles/*.dat"

-- make sure to put the file prototypes in double quotes.

You can easily check to see if you're going to get anything from a cpio backup by just putting the same file specs into a "tell" command. see below...
remsh rpludb02 "dd if=/dev/rmt/c2t11doBESTn" | cpio -iBtv "/data1/dfiles/*.dat"

If you see any files listed - then you can restore using the same file descriptor to restore...
remsh rpludb02 "dd if=/dev/rmt/c2t11doBESTn" | cpio -iBvmuxc "/data1/dfiles/*.dat"

If you're having trouble isolating you're files to restore in the backup - try going from general to specific...

First see if you can see anything at all...
remsh rpludb02 "dd if=/dev/rmt/c2t11doBESTn" | cpio -iBtv

Then see, if you can generate the syntax to pick up something right at the top of the list you just looked at. Once you know how to pick through the stuff at the top of list however you wish, you can apply the same technique to something buried way down in the file.

file sizes - cpio probably can't handle an individual file larger than 2G.

Now, all that being said - cpio has a serious drawback - it's probably the slowest backup method you can find. It has ONE single plus - it can back up special files (like those in the dev directory). - so unless you're backing up special files - I'd use tar if I were you.

tar cvf - /u* /* /psoft/*.{dbf,ctl} | compress | remsh rpludb02 " dd of=/dev/rmt/c2t11d0BESTn bs=64k "

read contents back like this...
remsh rpludb02 " dd if=/dev/rmt/c2t11d0BESTn bs=64k " | uncompress | tar tvf -

restore like ...
remsh rpludb02 " dd if=/dev/rmt/c2t11d0BESTn bs=64k " | uncompress | tar xvf -

We are the people our parents warned us about --Jimmy Buffett