This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Configuration | |
| . /etc/mysql/mysql_backup.conf | |
| # Dump the mysql databases to a daily dump file. | |
| function log() | |
| { | |
| logger -i -p daemon.info -t mysqldump "$1" | |
| echo $1 >> $LOGFILE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| aptitude -y install expect | |
| // Not required in actual script | |
| MYSQL_ROOT_PASSWORD=abcd1234 | |
| SECURE_MYSQL=$(expect -c " | |
| set timeout 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| while [ 1 ]; do if ['mysql -uroot -ppassword -e"show slave status \G;" | grep "Duplicate entry" | wc -l' -eq 2 ] ; then mysql -uroot -ppassword -e"stop slave; set global sql_slave_skip_counter=1; start slave;"; fi; sleep 1; mysql -uroot -ppassword -e"show slave status\G"; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| root@hudexchange-web:/var/www/vmhost/apps/hudexchange/scraps/mariadb_docker/replication/bergerx# dockerComposeVersion=1.13.0 | |
| root@hudexchange-web:/var/www/vmhost/apps/hudexchange/scraps/mariadb_docker/replication/bergerx# curl -L https://github.com/docker/compose/releases/download/$dockerComposeVersion/docker-compose-`uname -s`- `uname -m` > /usr/local/bin/docker-compose | |
| % Total % Received % Xferd Average Speed Time Time Time Current | |
| Dload Upload Total Spent Left Speed | |
| 100 617 0 617 0 0 3554 0 --:--:-- --:--:-- --:--:-- 3566 | |
| 100 8079k 100 8079k 0 0 367k 0 0:00:21 0:00:21 --:--:-- 417k | |
| root@hudexchange-web:/var/www/vmhost/apps/hudexchange/scraps/mariadb_docker/replication/bergerx# chmod +x /usr/local/bin/docker-compose | |
| root@hudexchange-web:/var/www/vmhost/apps/hudexchange/scraps/mariadb_docker/replication/bergerx# ./start.sh | |
| + export MYSQL_ROOT_PASSWORD=Oakton153 | |
| + MYSQL_ROOT_PASSWORD=Oakton153 |
NewerOlder