This file contains 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 | |
LOGFILE=/var/log/mysql_backup | |
DIR=/var/mariadb/ | |
DIRNEW="${DIR}backup_new/" | |
DIROLD="${DIR}backup_old/" | |
USER=YOUR_DB_USER | |
PASS=YOUR_DB_PASSWORD | |
date +"# Start Backup Mysql at %T %D" >> $LOGFILE | |
if [ ! -f %DIR ]; then | |
mkdir $DIR 2>> $LOGFILE |
This file contains 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 | |
#Set destination host | |
DHOST="lxchost2" | |
#Get list of running LXD containers | |
LXD_CONTAINERS=$(lxc list -c n,s --format csv | grep RUNNING | awk -F, '{print $1}') | |
LOGFILE="/var/log/lxcbackup.log" | |
LOCKFILE="/var/log/backuplxd.lock" | |
if [ -f %LOCKFILE ]; then | |
echo "Already running" >> $LOGFILE | |
exit 1 |
This file contains 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
validate: validate the schema, makes no changes to the database. | |
update: update the schema. | |
create: creates the schema, destroying previous data. | |
create-drop: drop the schema at the end of the session. |