Menu

Add an option for slave replication servers?

leftdrive
2007-10-12
2013-05-29
  • leftdrive

    leftdrive - 2007-10-12

    I'd like to suggest adding an option for replication so that this can be run on slaves servers using replication.

    Some of my larger databases were taking a long time to backup. Now I use replication and conduct backups on my slave.

    Add this to the start

    # Are we running this on a slave server?
    SLAVE_SERVER=yes

    if [ "$SLAVE_SERVER" = "yes" ]; then
    mysqladmin --user=$USERNAME --password=$PASSWORD stop-slave
    fi

    and this to the end
    if [ "$SLAVE_SERVER" = "yes" ]; then
    mysqladmin --user=$USERNAME --password=$PASSWORD start-slave
    fi

     
    • Chris Janton

      Chris Janton - 2007-10-12

      Why not just use the PREBACKUP and POSTBACKUP which are already there?

      PREBACKUP="cp /etc/my.cnf $BACKUPDIR ; mysqldump --version ; mysql -e \"show slave status\G\" ; mysqladmin stop-slave flush-tables flush-logs flush-status"

      POSTBACKUP="mysqladmin start-slave"

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.