Solved

Tar command  to span multiple TAR files

Posted on 2008-10-17
13
988 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
  • 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
 
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Skill Development 15 163
Dell OpenManage 8.3 Windows 10 2 125
Invalid password trying to cannect to Unix server 2 68
Shell Script on AIX 7 63
Goal:  To set up a secure SSH server for your home computer to make it accessible anywhere AND to use it as a port forwarding proxy. Steps 1.  WinSSHD version 5 is free for personal use.  So download and install it.  You can download it from the…
Introduction People like FTP.  It's a solid, stable, robust protocol for quickly transferring files between two hosts using TCP/IP.  In most cases it's much faster than SMB or CIFS, and certainly much easier to set up between organizations.  This…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now