HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

backup command

 
heaman1
Regular Advisor

backup command

my tape device path is /dev/rmt/0m

I would like to use cpio command , I tried to see the man page of cpio , but still can't get help ( I really headache with it )

can adivse if I want to backup , list and restore file from and to the tape , how to do it ? besides , if I want to extract a specific directory from the tape ( not all files in the tape , only restore a directory ) , what can i do ? thx
9 REPLIES
Johnson Punniyalingam
Honored Contributor

Re: backup command

Example :-

Copy the old data to new mountpoint
# cd /home/eem.old
# find . -xdev -print | cpio -pdmuxl /home/eem

can try as below ,

#cpio -pdmuxl file.tar /dev/rmt/0m

Hope this helps,

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
T G Manikandan
Honored Contributor

Re: backup command

create
# find . -print |cpio -ocBv /dev/rmt/0m

to list
# cpio -itcvB < /dev/rmt/0m

extract
# cpio -icvdBum file < /dev/rmt/0m
Bijeesh
Respected Contributor

Re: backup command

Hi,

You can use this command to take backup.
Go the required directory
#ls | cpio -o > /dev/rmt/0m

To restore from the tape use the following command

#cpio -i < /dev/rmt/0m

Rgds
Bijeesh
heaman1
Regular Advisor

Re: backup command

thx replies

I have problem to extract files,

I use cpio -i dev/cciss < /dev/rmt/0m , it pops

cpio: read error: Cannot allocate memory

i use cpio -icvdBum home/edp < /dev/rmt/0m ( to restore the directory /home/edp to local directory ) but it only create home/edp to local directory , this directory is empty , can advise is wrong ? thx
T G Manikandan
Honored Contributor

Re: backup command

were to able to list those files before the extract please?
cpio -itcvB < /dev/rmt/0m
B. Hulst
Trusted Contributor

Re: backup command

Why are you using cpio?
The command tar is also available and more common. :-)
heaman1
Regular Advisor

Re: backup command

thx replis ,

i also don't want to use cpio , but the command used in our company for long time , i can't change it ...


cpio -itcvB < /dev/rmt/0m is ok to list fies , now I would like to restore files from the tape , I use the below command but still not work , can advise what can i do ? thx

cpio -i dev/cciss < /dev/rmt/0m

cpio -icvdBum home/edp < /dev/rmt/0m

Re: backup command

>I also don't want to use cpio

Then don't, use a more rational command. You can use pax(1). And then add "-x cpio".

Re: backup command

>cpio -itcvB < /dev/rmt/0m is ok to list files,

pax -f /dev/rmt/0m -v

>restore files from the tape, I use the below command but still not work

pax -f /dev/rmt/0m -r -v dev/cciss