1753963 Members
7216 Online
108811 Solutions
New Discussion юеВ

Re: 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 9
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
Dennis Handly
Acclaimed Contributor

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".
Dennis Handly
Acclaimed Contributor

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