LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-27-2005, 03:45 PM   #1
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Rep: Reputation: 45
help with compressing a directory for backup


Hello, i understand that tar or gunzip or something along those lines will compress a directory. What i want to do is get maximun compression and at the same time make either an .img or .iso out of it so i can move it via a LAN and burn it out to a CD.

sadly it will be moved to a windows system as i have no clue how to mount a CDRW on a win2k server to a debian box for burning with cdrecord.

A. what command will give me the maximum compression for storage?

B. how can i | this into a mkiso so i can move it to a CD later on?

C. is it possible to mount a CDRW on a win2k server (yes it is currently shared over the windows domain, no the linux box is NOT part of the domain), if so how?

yes i have root and administrator access to the entire network for this.

Thank you.
 
Old 10-27-2005, 07:03 PM   #2
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 657

Rep: Reputation: 66
Among the standard tools 'bzip2 --best' can produce a well
compression level. For to extract the archive 'tar -xjOf'.
Where to send output? I did not ever use it. But the only
thing I can say - see the '-stream-media-size' option for
mkisofs.
 
Old 10-27-2005, 07:08 PM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,743

Rep: Reputation: 299Reputation: 299Reputation: 299
I'm not certain this will help, but I'll give it a try.

For backups, I use Dar. It makes backups which consist of individually archived files (contrary to tar). The options allow you to specify which files to NOT compress (i.e., files already compressed, specified by file extension).

A) Maximun compression, if I'm not mistaken, is achieved using bzip2, which is an option in DAR for file compression (I've compressed a 7.7 Gig installation to 2.7 Gig). Dar also has a list option, to list the contents of an archive. If any file is larger after compression, it is flagged with the word WORSE. Take note of the file extension; add that extension to the list of files to NOT compress, and increase the degree of compression by doing so.

B) Make your backup using Dar. Dar can be used to cut a monolithic backup into slices (or make the backup in slices) for writing to zip,jaz,cd,dvd,etc.

C) Windows has it's own tools for writing to cd. Just use Dar to created slices sized for cd. Transfer those files wherever you need them. Then write the slices to cd.
 
Old 10-27-2005, 07:56 PM   #4
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Original Poster
Rep: Reputation: 45
Quote:
Originally posted by Ygrex
Among the standard tools 'bzip2 --best' can produce a well
compression level. For to extract the archive 'tar -xjOf'.
Where to send output? I did not ever use it. But the only
thing I can say - see the '-stream-media-size' option for
mkisofs.
ok if i do this, once i get it out to CD, how would i uncompress it if i have to recover?


ill look into DAR as well bigrigdriver
 
Old 10-27-2005, 08:04 PM   #5
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,743

Rep: Reputation: 299Reputation: 299Reputation: 299
Hopefully, tar -zx <filename> or tar -Zx <filename> will work. I don't find an option specifically dedicated to extracting a bzip2 archive. That leaves only -z (gzip or gunzip) and -Z (compress). That's why I recommended Dar.

PS: gzip/gunzip are part of the same utility. Compress is the original Unix compression/decompression utility (did I get that correctly, gurus?).

Last edited by bigrigdriver; 10-27-2005 at 08:07 PM.
 
Old 10-27-2005, 08:24 PM   #6
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Original Poster
Rep: Reputation: 45
ok, what did i do wrong. i want the /www directory and everything in it:

Code:
tar -xjOf /www /home/ray/web_back
tar (child): /www: Cannot read: Is a directory
tar (child): At beginning of tape, quitting now
tar (child): Error is not recoverable: exiting now

bzip2: Compressed file ends unexpectedly;
        perhaps it is corrupted?  *Possible* reason follows.
bzip2: Invalid argument
        Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

tar: Child returned status 2
tar: /home/ray/web_back: Not found in archive
tar: Error exit delayed from previous errors
thanks.
 
Old 10-27-2005, 09:47 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,965
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
You forgot to specify a file-name for the archive... and you're
trying to extract the data from a non-existing archive.

tar cjf my_archive.tar.bz2 /www /home/ray/web_back

And man, you've been a member for over two years :)
You really should have learnt how to read a man-page
by now ;}


Cheers,
Tink

Last edited by Tinkster; 10-27-2005 at 09:49 PM.
 
Old 10-27-2005, 11:09 PM   #8
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Original Poster
Rep: Reputation: 45
Quote:
Originally posted by Tinkster
You forgot to specify a file-name for the archive... and you're
trying to extract the data from a non-existing archive.

tar cjf my_archive.tar.bz2 /www /home/ray/web_back
thank you.
Quote:
And man, you've been a member for over two years
You really should have learnt how to read a man-page
by now ;}


Cheers,
Tink
only problem is, when i read most man pages, i dont comprehend enough of what is said. some are written for an idiot newbie like me, but others assume to much. ill keep trying.
 
Old 10-28-2005, 02:52 AM   #9
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 657

Rep: Reputation: 66
And please, do not extract files with '-O'
option on the terminal! I did mentioned it
for you want to use mkisofs. So you can
redirect output to that application. But
you should use mkisofs with somewhich
option I do not remember (and never knew).
But when I search for 'stdin' on the
mkisofs's manpage I find the only matching.
I suppose it is exactly what you need.

I firstly meet Dar. I never used it. So ask
bigrigdriver of it.
 
  


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 of directory sanjibgupta Linux - Networking 2 09-05-2005 12:32 AM
strange problem while compressing a directory kartheekpn Linux - General 5 08-04-2005 12:39 PM
Compressing/Zipping A Directory Wha?Where? Linux - Newbie 4 07-07-2005 09:20 PM
Compressing directory with bzip2 Haiyadragon Linux - Newbie 1 06-22-2005 05:13 PM
Backup, directory, permissions. linuxgamer Linux - Distributions 0 11-19-2003 06:07 PM


All times are GMT -5. The time now is 09:09 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