View Single Post
  #8 (permalink)  
Old 07-11-2009, 08:33 PM
Spiral's Avatar
Spiral Spiral is offline
Registered User
 
Join Date: Jun 2005
Location: Area 51
Posts: 1,501
Spiral is on a distinguished road
Exclamation

Quote:
Originally Posted by cpanelerice View Post
If you wanted to gzip or bzip, just add it to the line after the mysql dump to look like this:

gzip /path/to/dbbackup-$(date +%m%d%Y).sql

or

bzip2 /path/to/dbbackup-$(date +%m%d%Y).sql

I'd try both and see which one gives you better compression on your system.
Just a technical note to answer your question ...

BZIP2 uses much tighter compression than GZIP and will in every case
I have every seen the output is substantially smaller than GZIP.

The disadvantage to BZIP is that it is a slower process so if you are
in a big hurry then GZIP might be better since it is very quick but
if you are looking at space then BZIP2 is definitely the better choice.

ZIP, another option, varies depending on content and may be
slightly smaller or larger than BZIP2 depending on what you are
compressing. Same goes for RAR which tends to have output sizes
very comparable to BZIP2 for most output files.

A newer one, LZIP, is the only one I have seen on standard linux
environments that outputs consistently smaller than BZIP2 but
LZIP is much slower than either GZIP or BZIP2 but it does output
some impressively tight compression.

LZIP isn't added by default with most distributions so you will probably
need to download and compile the source if you want it available on
your server but it is good if you want really tight files that can be
transferred very quickly. Like I said, the disadvantage is that it is
very slow so you probably don't want to build archives on huge files.
For that, BZIP2 is a better compromise between speed and filesize.
Reply With Quote