2020-02-03 20:06:20 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
BACKUP_DIR="/backup/database"
|
|
|
|
|
|
|
|
echo "Starting to backup database"
|
2020-02-03 21:48:03 +00:00
|
|
|
|
2020-02-03 20:06:20 +00:00
|
|
|
mkdir --parents $BACKUP_DIR
|
|
|
|
mysqldump --single-transaction --host=$MYSQL_BACKUP_HOST --user=$MYSQL_BACKUP_USER --password=$MYSQL_BACKUP_PASSWORD $MYSQL_BACKUP_DATABASE > $BACKUP_DIR/$MYSQL_BACKUP_DATABASE.sqldump
|
|
|
|
|
|
|
|
echo "Database backup finished"
|