27
31
# Normally this will be empty anyway, but it will save our admin
28
32
# if he accidentally relates a master with some other master!
29
33
backup=/var/backups/alldbs-`date +%Y%m%d%H%M%S`.sql.gz
30
34
mysqldump $ROOTARGS --all-databases --single-transaction |gzip> $backup
35
36
mysql $ROOTARGS -e "RESET SLAVE"
37
mysql $ROOTARGS -e "CHANGE MASTER TO MASTER_HOST='$ip', MASTER_USER='$user', MASTER_PASSWORD='$password', MASTER_PORT=$port"
36
38
echo Importing $dumpurl into MySQL
37
39
curl --silent --show-error $dumpurl |zcat| mysql $ROOTARGS
38
40
# Root pw gets overwritten by import