puppetlabs/puppetlabs-mysql — pull request #170 by omalashenko (2013-04-23 12:01:15+00:00)
Title: Harden mysqlbackup.sh script

* mysql::backup backuprotate parameter sets the number of backups to keep, default is 30.
* Use bash in mysqlbackup.sh to get exit status of mysqldump when piped to bzip2. Unfortunately there is no easy portable way to do that.
* Only delete old backups when current backup finished successfully.
* Try hard not to delete files that we didn't create (i.e. README or other backups).