LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 11-16-2009, 09:58 AM   #1
garydale
Member
 
Registered: Feb 2007
Posts: 118

Rep: Reputation: 22
split - rejoin problem on tar.bz2 backup


Call me old school, but I've been running a server backup using a simple custom script & a cron job to create a backup to dvd-ram.

The theory behind the it is I create a tar.bz2 file on disk, split it into 1G segments (using split) to avoid the old (obsolete, but never got around to removing it from my script) 1G limit on UDF files) then copy the split portions to dvd-ram.

As the backup progresses, I compare the dvd-ram segments to the segments on disk before erasing them. I send myself an e-mail on compare failure (I give the copy/compare three tries before declaring failure).

However, when I (rarely) get called to restore a file, I get into problems. "cat"ing the files together to recreate the original tar.bz2 file leaves me with corruption on the bz2 file.

I can generally get the file back after much wailing and gnashing of teeth, but I'm hoping someone can figure out what is going wrong.

Thanks.
 
Old 11-17-2009, 12:02 AM   #2
anotherlinuxuser
Member
 
Registered: Jan 2007
Location: Alberta Canada
Distribution: Fedora/Redhat
Posts: 63

Rep: Reputation: 19
You may want to try 'bzcat' instead of 'cat' to rejoin the files into one bz2 file. bzcat will attempt to create a valid .bz2 file. 'cat' will blindly join the files, but will do no consistency checks. btw, there is also 'zcat' for gzipped files.
 
Old 11-18-2009, 12:15 PM   #3
garydale
Member
 
Registered: Feb 2007
Posts: 118

Original Poster
Rep: Reputation: 22
Quote:
Originally Posted by anotherlinuxuser View Post
You may want to try 'bzcat' instead of 'cat' to rejoin the files into one bz2 file. bzcat will attempt to create a valid .bz2 file. 'cat' will blindly join the files, but will do no consistency checks. btw, there is also 'zcat' for gzipped files.
Not quite. bzcat unzips while concatenating. It won't join a split bzip2 file because the first "archive" ends unexpectedly - at the split point. The output of bzcat is an unzipped file or files.

I actually tried your suggestion in case the man pages were wrong, but bzcat behaves as I described.

Thanks anyway.
 
  


Reply

Tags
bzip2, cat, split, tar


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
Extract split tar.bz2 on server BiggySmalls Linux - Newbie 6 10-11-2009 09:15 PM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
Split Command... How to Rejoin? Quantumstate Linux - Software 2 11-03-2006 02:49 PM
problem unzipping a tar.bz2 file tar: Error is not recov jyome Linux - Software 4 09-04-2003 01:04 PM
How to rejoin split files SharpyWarpy Linux - General 2 02-07-2003 02:42 PM


All times are GMT -5. The time now is 08:39 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration