Tar command to span multiple TAR files

HELP HELP HELP

I have a 60gig file and trying to back it up to a SAMBA share which has a 2gig max size allowance.   Idea is to TAR the files but need to know how to use the TAR command to be able to create multiple TAR files as it is backing up.

Is a pain because the SAMBA share only is able to take 2gig files but does anyone know how to use the TAR command to be able to zip up 60 gig of data but output the tar files in 2 gig chunks and name them apropriatly

Regards


Terry
LVL 5
ncomperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bryan ButlerCommented:
Use the -M with the tape-length options. The thing is the file need to be compressed already since you cannot use the -M option AND compression.
ex: $tar -c -M -L=200000 -f=tarfiel.tar <zipped file>.tgz
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
omarfaridCommented:
I don't think tar can split the backup the way you described. Why the file is so big?

you may try command like split

http://unixhelp.ed.ac.uk/CGI/man-cgi?split
0
ncomperAuthor Commented:
I dont think that this works our problem is that we can only have 2 gig file sizes and need to the tar or command to automatically break the volume up into multiple file
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Bryan ButlerCommented:
I tried it and it works for me.  Are you getting an error?
0
omarfaridCommented:
You may use the the split command with the -b option where you specify the split size:

split -b 2000m
0
ncomperAuthor Commented:
does that automatically name the splits or do you have to manually enter the split names ?

thanks
0
omarfaridCommented:
it can do it automatically and you may optionally specify the prefix. Please see the man page or the link provided.

0
ncomperAuthor Commented:
Hi,

Had this comment back from the server guy is this correct ???

"The split command would be useful to chop up the tar file once created. However we needed to split the tar file up during creation."
0
omarfaridCommented:
Ok,

What I recommended is

Why do you need to tar the file itself. If the it is only that you want to back it up on a samba share, then split the file with split command. The split command will not remove the file you want to split. It will create new splits (files) in the dir or share. This way you have the splits on the share and the original file in its place.
0
ncomperAuthor Commented:
Cool can you select a target drive of multiple files of all different sizes (over and under 2 gig) then select a tar destination for the mutliple tar files and then split.  Is this posssible what would the command look like.

Regards
0
omarfaridCommented:
Can you explain what is the need for using tar here ? If the need is only to take backup of this file to another dir (which is basically a samba share) then you need to put the splits on that share

e.g.

cd /sambashare

split -b 2000m /path/to/myfile myfile_

This will take you to the samba share dir then create splits of the file that have their names starting with myfile (e.g. myfile_aa myfile_ab ...)
0
Bryan ButlerCommented:
Please let me know if my suggestion doesn't work.  If not, please let me know the error.
0
ncomperAuthor Commented:
Thankss to you both for your help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Server Software

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.