LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-07-2008, 03:51 AM   #1
skate
Member
 
Registered: Aug 2003
Location: Bulgaria
Distribution: OpenSuse 10.3, Debian 4.0r3 "Etch", FreeBSD 7.1, Ubuntu
Posts: 210

Rep: Reputation: 30
Question System Backup - TAR file in Pieces by 4.7GB ....


Hello folks, I want to make FULL BackUp on my Mail Server but its almost 20GB of files ....., Thats why I want to make the backup on TAR files in pieces of 4.7GB to write them to DVDs.
Does any one knows a way to do that? Software or .....?
Thanks.
 
Old 08-07-2008, 03:59 AM   #2
huwnet
Member
 
Registered: Jan 2006
Location: England
Distribution: Arch
Posts: 119

Rep: Reputation: Disabled
You could make one large tar and then split it using the split command
 
Old 08-07-2008, 04:51 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Look in the tar info manual in section, "9.6.1 Archives Longer than One Tape or Disk". Use the -M and --tape-length options to create multi-volume archives of a certain size. Using "split" you have to cat the files together before extracting the files. If the files are stored on disk then you could pipe the output of cat to tar, but cat'ing from multiple DVDs directly you would probably need to create a fifo file and in one shell, cat each segment in turn from the DVD file to the FIFO file, and in another console, get the input of tar from the same FIFO file.

Using a multi-volume archive would be easier and less error prone. For example, suppose a scratch ruined one of the dvd's. Each multi-volume file is a standalone archive that you can extract files from. One exception is if a very large file spans multiple volumes.
 
Old 08-07-2008, 04:52 AM   #4
skate
Member
 
Registered: Aug 2003
Location: Bulgaria
Distribution: OpenSuse 10.3, Debian 4.0r3 "Etch", FreeBSD 7.1, Ubuntu
Posts: 210

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by huwnet View Post
You could make one large tar and then split it using the split command
Thanks, I will try it
 
Old 08-07-2008, 05:01 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I take back the fifo idea. I though that further reads would be blocked until the end of the archive, but I was wrong.
(I tested the idea after my post)

You could create a separate fifo file for each disk, let's say fifo-disk1, fifo-disk2, ... fifo-disk5, for example.
Then in one shell, enter
cat fifo-disk? | tar xf -

In another shell cat each backup slice into the respective fifo file:
cat /media/dvd/backup-Aug10-2008.a >disk1
load in the next disk after it's done and enter
cat /media/dvd/backup-Aug10-2008.b >disk2

This obviously isn't so easy so using Multivolume tar backups would be the way to go.

Another alternative is to use the dar program instead. It is similar to tar but is written with backing up to discs instead. There is also a kde front end program called kdar that can make using it easier. You could set up a backup in kdar and then export the bash command. This can make it easier to automate backups in a cron job. For example, you could backup to a network share or a large enough directory. The job will create slices the size you want which you can burn to DVDs at your convenience. Or you could create one slice at a time if you run dar or kdar manually and burn each slice onto a DVD before resuming.

====
I did test multiple fifo's. I created a tar backup of my ~/downloads/ directory. Then I used "split -b 10M backup.tar" which created a number of files: xaa, xab ... xai. I could have used better options for split to preserve the basename of the backup. Then I created the fifo files: for file in xa?; do fifo fifo-$file; done

Next I opened another tab in konsole and ran "cat fifo-xa? | tar -tf -"

Then one at a time I cat'ed each segment into the respective fifo file:
cat xaa >fifo-xaa
cat xab >fifo-xab
...
cat xai >fifo-xai

The output of tar would be pause between each cat command.

---

Sorry for posting so much about a technique that I am not recommending, but I was curious how restoring slices of a tar archive file from DVDs could be done directly from the DVD.

Last edited by jschiwal; 08-07-2008 at 05:33 AM.
 
Old 08-07-2008, 06:15 AM   #6
skate
Member
 
Registered: Aug 2003
Location: Bulgaria
Distribution: OpenSuse 10.3, Debian 4.0r3 "Etch", FreeBSD 7.1, Ubuntu
Posts: 210

Original Poster
Rep: Reputation: 30
Thank you jschiwal thats very helpful..., I backup my server too, later.
Thanks again.
 
Old 08-09-2008, 07:30 PM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Your welcome. It gave me an opportunity to test how to restore from DVD's containing slices of a backup. Not being able to use a single fifo file to do it wasn't what I expected, so I learned something as well.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup and restore system.... tar.gz? lebabyg Linux - General 10 09-28-2007 09:16 AM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
Tar syntax to backup system... robbow52 Debian 5 08-05-2004 11:35 AM
system backup with tar tjay Linux - General 3 06-09-2004 11:32 AM
Backup entire system with tar sln Linux - General 2 04-30-2004 03:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration