cytopia / mysqldump-secure

[sh] Encrypted mysqldump script with compression, logging, blacklisting and Nagios/Icinga monitoring integration
https://mysqldump-secure.org
147 stars 38 forks source link

User defined compression engine #14

Closed Paike closed 8 years ago

Paike commented 8 years ago

Bzip2 creates smaller files than gzip. I did not want to hardcode it, so with this patch one can define the compression engine in the config file.

cytopia commented 8 years ago

This is a good idea to make it dynamically adjustable. There are however some more thoughts required. For example:

:746                    (${GZIP} --stdout -9 || echo "1:$?" >&3) |
...
:760                    (${GZIP} -9 > "${TARGET}/${PREFIX}${db}${ext}" || echo "1:$?" >&3)

Note: Just noticed, that the arguments for gzip don't even match in the current version (my bad).

Not all compressors use the same arguments. So probably it needs another var, that will specify the arguments for the chosen compressor, or to have a block of available compressors to choose from.

So any heads-up on what other compressors can be used apart from

I will leave this open for now.

cytopia commented 8 years ago

Thanks for the idea. I have added it manually now. Idea is credited in CHANGELOG

I also ignored POST_SCRIPT for the moment. eval doesn't seem to be such a good idea to me. Also didn't quiet understand what usecase it could have.

Paike commented 8 years ago

Great, thank you for adding it :)

cytopia commented 8 years ago

FYI: I also added pbzip2 (multi-threaded version of bzip2) and did some performance comparisons: https://github.com/cytopia/mysqldump-secure/blob/master/doc/COMPRESSION.md

Paike commented 8 years ago

Thanks, I did not know about pbzip, but I will use it from now on

cytopia commented 8 years ago

Hi @Paike , I am just about to finish the project website and would like to give credit to your contribution here: http://mysqldump-secure.org/contribution.php

But I am also not adding people who don't wish to appear there. So If you like to be mentioned, I will add you, just reply back to me here.

Paike commented 8 years ago

Sorry, did not come here often... I will be honoured to be mentioned, thank you :)

cytopia commented 8 years ago

Was too busy working on the current version. Finally made it :-) http://mysqldump-secure.org/contribution.php