Solved

Tar command  to span multiple TAR files

Posted on 2008-10-17
13
1,011 Views
Last Modified: 2013-12-02
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
0
Comment
Question by:ncomper
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 3
13 Comments
 
LVL 16

Accepted Solution

by:
Bryan Butler earned 250 total points
ID: 22743838
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
 
LVL 40

Expert Comment

by:omarfarid
ID: 22743883
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
 
LVL 5

Author Comment

by:ncomper
ID: 22744699
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
Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

 
LVL 16

Expert Comment

by:Bryan Butler
ID: 22753773
I tried it and it works for me.  Are you getting an error?
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 22754810
You may use the the split command with the -b option where you specify the split size:

split -b 2000m
0
 
LVL 5

Author Comment

by:ncomper
ID: 22759248
does that automatically name the splits or do you have to manually enter the split names ?

thanks
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 22764450
it can do it automatically and you may optionally specify the prefix. Please see the man page or the link provided.

0
 
LVL 5

Author Comment

by:ncomper
ID: 22765404
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
 
LVL 40

Expert Comment

by:omarfarid
ID: 22765651
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
 
LVL 5

Author Comment

by:ncomper
ID: 22765876
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
 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 250 total points
ID: 22768182
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
 
LVL 16

Expert Comment

by:Bryan Butler
ID: 22769238
Please let me know if my suggestion doesn't work.  If not, please let me know the error.
0
 
LVL 5

Author Closing Comment

by:ncomper
ID: 31507211
Thankss to you both for your help
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question