Results 1 to 6 of 6

Thread: Problems running post-backup plugin

Threaded View

  1. #1

    Default Problems running post-backup plugin

    Hi,

    I'm using mysql-zrm 3.0 on CentOS release 5.11 and want to use the post-backup plugin but can't seem to get it to work.

    I configured it in the /etc/mysql-zrm/lincoln/mysql-zrm.conf with the following lines:

    Code:
    post-backup-plugin="/usr/share/mysql-zrm/plugins/post-backup.pl"
    post-backup-plugin-options="AAAAA BBBBB"
    I also configured the /usr/share/mysql-zrm/plugins/post-backup.pl script to do something:

    Code:
    ---8<---
     59 $argsize = @ARGV;
     60 print "Found $argsize elements in ARGV array\n";
     61 
     62 foreach( @ARGV ){
     63         print "Found agument: ";
     64         print "$_\n";
     65         #system('mysql -h host -uuser -psecret -e "purge master logs before date_sub(now(), interval 3 day);" databasename');
     66 }
     67 print "The 'foreach' had it's chance. Did it print a message?\n";
     68 exit(0);
    ---8<---
    but I can't see that it's being called at all. Here's some logging from /var/log/mysql-zrm/mysql-zrm.log:

    Code:
    Mon Feb 09 00:00:01 2015: lincoln:backup:INFO: START OF BACKUP
    Mon Feb 09 00:00:01 2015: lincoln:backup:INFO: PHASE START: Initialization
    Mon Feb 09 00:00:01 2015: lincoln:backup:INFO: The quick backup-type is supported only for snapshot backups. Setting backup-type to 'regular'
    Mon Feb 09 00:00:01 2015: lincoln:backup:INFO: backup-set=lincoln
    Mon Feb 09 00:00:01 2015: lincoln:backup:INFO: backup-date=20150209000001
    Mon Feb 09 00:00:01 2015: lincoln:backup:INFO: mysql-server-os=Linux/Unix
    Mon Feb 09 00:00:01 2015: lincoln:backup:INFO: backup-type=regular
    Mon Feb 09 00:00:01 2015: lincoln:backup:INFO: host=lincoln.motec.com.au
    Mon Feb 09 00:00:01 2015: lincoln:backup:INFO: backup-date-epoch=1423400401
    Mon Feb 09 00:00:01 2015: lincoln:backup:INFO: retention-policy=7D
    Mon Feb 09 00:00:01 2015: lincoln:backup:INFO: mysql-zrm-version=ZRM for MySQL Community Edition - version 3.0
    Mon Feb 09 00:00:01 2015: lincoln:backup:INFO: mysql-version=5.1.73-log
    Mon Feb 09 00:00:01 2015: lincoln:backup:INFO: backup-directory=/var/lib/mysql-zrm/lincoln/20150209000001
    Mon Feb 09 00:00:01 2015: lincoln:backup:INFO: backup-level=1
    Mon Feb 09 00:00:01 2015: lincoln:backup:INFO: PHASE END: Initialization
    Mon Feb 09 00:00:01 2015: lincoln:backup:INFO: PHASE START: Running pre backup plugin
    Mon Feb 09 00:00:01 2015: lincoln:backup:INFO: PHASE END: Running pre backup plugin
    Mon Feb 09 00:00:01 2015: lincoln:backup:INFO: PHASE START: Flushing logs
    Mon Feb 09 00:00:02 2015: lincoln:backup:INFO: PHASE END: Flushing logs
    Mon Feb 09 00:00:02 2015: lincoln:backup:INFO: PHASE START: Creating incremental backup
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: incremental=mysql-bin.[0-9]*
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: PHASE END: Creating incremental backup
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: PHASE START: Calculating backup size & checksums 
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: next-binlog=mysql-bin.000354
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: last-backup=/var/lib/mysql-zrm/lincoln/20150208000002
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: backup-size=0.05 MB
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: PHASE END: Calculating backup size & checksums 
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: PHASE START: Compression/Encryption
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: compress=
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: backup-size-compressed=0.01 MB
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: PHASE END: Compression/Encryption
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: read-locks-time=00:00:00
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: flush-logs-time=00:00:01
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: compress-encrypt-time=00:00:00
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: backup-time=00:00:02
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: backup-status=Backup succeeded
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: Backup succeeded
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: PHASE START: Running post backup plugin
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: PHASE END: Running post backup plugin
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: PHASE START: Cleanup
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: PHASE END: Cleanup
    Mon Feb 09 00:00:03 2015: lincoln:backup:INFO: END OF BACKUP
    Mon Feb 09 04:00:01 2015: purge:INFO: Purging Backup /var/lib/mysql-zrm/lincoln/20150202000002
    Why don't I see any of my perl print messages in the logs?

    When I actually have the perl system call un-commented (line 65), it doesn't seem to do anything either (note that I have changed the configured options for the mysql system call to protect the innocent in this post).

    What am I missing here? How can I call the post-backup script and have it do something useful?

    Is there a way to do a dry-run/test call for mysql-zrm to see what happens without affecting a running system?

    I've done this to see some results:

    Code:
    # pwd
    /usr/share/mysql-zrm/plugins
    # ./post-backup.pl AAAAA BBBBB
    Found 2 elements in ARGV array
    Found agument: AAAAA
    Found agument: BBBBB
    The 'foreach' had it's chance. Did it print a message?
    Also, I'm quite confused over the (limited) documentation for this plugin. I have not worked out what parameters (or the syntax) will be passed and when. What does it mean in the post-backup.pl comments when it says: "The second time the post-backup-plugin is called it will have 2 parameters" ?

    Clearly I am confused. I'm not a perl programmer but it's not the first time I've written/customised perl scripts. I can work through the syntax of most scripting languages without issues (php, javascript, ...). I used to program C and Java, and script regularly in bash so I do know something about coding. A clear example of the post-backup.pl would say a 1000 words in helping me understand this plugin.

    Someone please hit me with a clue stick. Thanks in advance.

    Kind regards,
    Tom
    Last edited by yzenezy; March 1st, 2015 at 04:56 PM. Reason: Put in CODE blocks for easier reading

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •