Operating System - HP-UX
1833974 Members
1766 Online
110063 Solutions
New Discussion

how to use tar cmd backup files into tape

 
gary_35
Advisor

how to use tar cmd backup files into tape

there are two kind of files , i wanna tar one kind of files into one tar file(for example a.tar) ,and tar another kind of files into another tar file (for example b.tar)

i wanna backup a.tar and b.tar into the same tape ,how can i do that ?
4 REPLIES 4
Michael Steele_2
Honored Contributor

Re: how to use tar cmd backup files into tape

find . -name "*pattern*" | cpio -oBx > file

To read table of contents use:
cpio -itumvB < file

To extract:
cpio -idumvB < file

This also might work:
find . -name "*pattern*" | xargs tar -cvf file

To read table of contents:
tar -tvf file

To extract:
tar -xvf file
Support Fatherhood - Stop Family Law
CCIL
Frequent Advisor

Re: how to use tar cmd backup files into tape

Hi
the comaand is
tar -cvf /dev/rmt/Xmn a.tar b.tar

X is number , u need to get that number using command ioscan -kfnC tape
Amit Vichare
Michael Tully
Honored Contributor

Re: how to use tar cmd backup files into tape

Make sure that you use a filesystem that has enough room.
use 'bdf' to determine.
e.g.
# cd /mydir1
# tar cvf /tmp/a.tar
# cd /mydir2
# tar cvf /tmp/b.tar
# cd /tmp
# tar cvf /dev/rmt/0m *.tar
Anyone for a Mutiny ?
KapilRaj
Honored Contributor

Re: how to use tar cmd backup files into tape

Hi,

tar cvf a.tar /dev/rmt/Xmn (Do not eject the tape)
tar cvf b.tar /dev/rmt/Xmn

Now if u need to retrieve a.tar Do as following ,

Insert the tape
mt rew
tar xvf /dev/rmt/Xmn

To retrieve b.tar

mt fsf 1
tar xvf /dev/rmt/Xmn

Where X = a unique number notifying the device number.

/dev/rmt/Xm(n) does not rewind the tape. It simply adds another session on the same tape.

Regds,

kaps
Nothing is impossible