1777014 Members
1987 Online
109062 Solutions
New Discussion

Re: Help in cpio needed

 
Daniel Schneider_4
Occasional Advisor

Help in cpio needed

Hi all,
I need the command options to backup several directories with cpio:

1. How to backup the dir /home/users/xyz to /dev/rmt/0m
2. How to list the files of that Backup
3. How to add the dir /etc to that archive
4. How to restore the Tape on other system (e.g. IBM, or SUN)
5. How to restore the file /etc/test.txt from the stored Tape to the dir
/home/users/xyz/test.txt.

Any help is nedded.

Regards
Daniel
1 REPLY 1
Atif Malik_2
Frequent Advisor

Re: Help in cpio needed

1) To backup the directory /home/users/xyz to /dev/rmt/0m

# cd /home/users/xyz
# find . -xdev -depth | cpio -ocx > /dev/rmt/0m

2) To list the files of that backup
# cpio -ictv < /dev/rmt/0m

3) cpio (1) doesn't support the append. The backup utility that does support
append mode is tar (1).

4) How to restore the tape on another system:
# cpio -iudmcx < /dev/rmt/0m

5) How to restore the file /etc/test.txt from tape to the directory
/home/users/xyz/test.txt
# cd /home/users/xyz
# cpio -icvdxumB < /dev/rmt/0m test.txt

Regards,
Atif