Coder Social home page Coder Social logo

bacula-backup-mysql's People

Contributors

glensc avatar norbini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bacula-backup-mysql's Issues

Password Not Correctly Passed to mysqldump

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

Handling empty databases

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.