LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   help with compressing a directory for backup (https://www.linuxquestions.org/questions/linux-newbie-8/help-with-compressing-a-directory-for-backup-377523/)

Lleb_KCir 10-27-2005 03:45 PM

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.

Ygrex 10-27-2005 07:03 PM

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.

bigrigdriver 10-27-2005 07:08 PM

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.

Lleb_KCir 10-27-2005 07:56 PM

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

bigrigdriver 10-27-2005 08:04 PM

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?).

Lleb_KCir 10-27-2005 08:24 PM

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.

Tinkster 10-27-2005 09:47 PM

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

Lleb_KCir 10-27-2005 11:09 PM

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.

Ygrex 10-28-2005 02:52 AM

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.


All times are GMT -5. The time now is 08:25 PM.