sixninetynine/surrogate — pull request #12 by seba-sge (2013-04-05 06:06:27+00:00)
Title: new features, more user friendliness

Some changes off the top of my head:
Design
- do not chown data directory during installation. I don't think installing a backup script should allow the user to break their database server during installation if they put in the wrong user.
- slightly simplified structure. combined surrogate lib into the main script file
- move backup / restore logic to surrogate.conf, so it's more visible and can be easily customized.
- no more log files. everything is outputted to stdout. I personally find it more useful than having 5 log files.
- toggable autorotate option. some people might want to rotate outside of surrogate.
- if autorotate is on, only do that when taking backups, never on restoring (presumably when restoring you're in an emergency type situation, so you don't want to rotate any backups)
- restructured layout. vars on top, then functions, then logic. - again completely arbitrary.. this is just how I like it.
- do not read ALL files from config dir. only source surrogate.conf and xtrabackup.conf. Many people (including myself) save their configs with .sav or .bak before changing stuff around. When you read all files in the configdir, vars from the .sav file will overwrite your original config file, which is confusing.
- replaced default paths and vars in config file with to avoid specific edge cases with sed in the installer.

Features
- dump option for mysqldumps. use with surrogate -b dump
- auto detect whatever possible during installation: mysql creds from ~/.my.cnf, socket, mysql system user, datadir
- removed mysqldmulti flags from backup actions (defaults-group i think it's called) -- for now. I couldn't wrap my head around it and I didnt feel it was necessary for AJ. I would like to work on that though.
- added catch function for easy exit code handling. put it after any command to check its exit code and exit surrogate if != 0. also supports outputting status code to a file (for Nagios hooks)