1845947 Members
3368 Online
110250 Solutions
New Discussion

Re: Tar command queries

 
SOLVED
Go to solution
Henry Chua
Super Advisor

Tar command queries

Hi all,

I have some queries involving tar command..

1. if I have very big file that cannot be contained in just one tape can I tar them into multiple tape drives?

2. I bee trying but keep failing.. How can I extract a specific file or directory from a archived tape.. is it possible in the first place?

Thank you all for your kind advise!!
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: Tar command queries

2) Yes tar can extract a specific file or directory

tar xvf /dev/rmt/1mnb /usr/mydir

will extract /usr/mydir and all subdirectories; if a file is specified just that file will be extracted.

I suspect that you are having problems with the filenames. Do a tar vtf /dev/rmt/1mnb first to list the files so that you can see the pathnames.
------------------------------------------

Tar really doesn't span tapes on its own. You can use cpio which does or better still if this is HP-UX to HP-UX use fbackup/frecover. Even the Gnu version of tar and cpio have an 8GB filesize limit so that if you need to backup and restore files larger than this then fbackup is your only "free" option but it is HP-UX specific.

Your other option is to use split to divide the files and back them up in chunks; you can cat them together for the restore.
If it ain't broke, I can fix that.
Henry Chua
Super Advisor

Re: Tar command queries

Hi Stephenson,

Thank you for your kind notes..
but can u advise me on what is the correct way I should used to span a big files into multiple disks using cpio?
T G Manikandan
Honored Contributor

Re: Tar command queries

Just use cpio like
#cd dir
#find . | cpio -ocB >/dev/rmt/??
Henry Chua
Super Advisor

Re: Tar command queries

Thanks TG for your reply...

Can I ask you what does each of the command does.. and what do I expect from the command...if I intend to span them to 2 disk?

Many thanks for your help..
T G Manikandan
Honored Contributor
Solution

Re: Tar command queries

Just use cpio like
#cd dir

you are changing dir which requires backup
#find . | cpio -ocB >/dev/rmt/??

then you print all the files from that directory and pipe the ouput to cpio which writes on to a tape.

cpio prompts automatically to enter the name of the device files once it spans multiple tapes.No options is requried for that