glensc / bacula-backup-mysql Goto Github PK
View Code? Open in Web Editor NEWMySQL backup hook for Bacula
MySQL backup hook for Bacula
add
push(@shell, '--old_server');
to bacula-backup-mysql.pl supported from config
There was an issue I encountered using this script with mysqldump on Debian/Ubuntu. It would consistently ask me for my password when performing the command, and then error out saying my password was not a valid "database". I believe this is related to how the password is being passed to mysqldump (see below):
90: push(@shell, '-p', $password) if $password;
The following seemed to fix it for me:
90: push(@shell, "-p$password") if $password;
mysqldump requires passing the password directly after the "-p" parameter or it will error, at least in my experience.
Thanks
When mysqlhotcopy encounters empty database it exits with code 2304, thus causing Bacula backup to fail for entire set of MySQL databases. To avoid bogus issue, I added workaround into your script:
--- bacula-backup-mysql.pl 2012-12-21 11:21:21.000000000 -0500
+++ bacula-backup-mysql_orig.pl 2012-12-21 10:58:41.000000000 -0500
@@ -156,15 +156,7 @@
push(@shell, $db, $dstdir);
print ">>>> mysqlhotcopy $database\n";
- my $rc = system(@shell);
- if ($rc == 2304) {
- mkdir("$dstdir/$database");
- print "mysqlhotcopy $database empty";
- } elsif ($rc == 0) {
- print "mysqlhotcopy $database succeeded";
- } else {
- die "mysqlhotcopy failed: $rc\n";
- }
+ system(@shell) == 0 or die "mysqlhotcopy failed: $?\n";
# put it to "production dir"
my $cluster_dir = "$backup_dir/$cluster";
Regards,
Nikolay
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.