11 lines
364 B
Bash
11 lines
364 B
Bash
#!/usr/bin/env sh
|
|
|
|
BACKUP_DIR="/backup/database"
|
|
|
|
echo "Starting to backup mysql database"
|
|
|
|
mkdir --parents $BACKUP_DIR || exit 1
|
|
mysqldump --single-transaction --host=$MYSQL_BACKUP_HOST --user=$MYSQL_BACKUP_USER --password=$MYSQL_BACKUP_PASSWORD $MYSQL_BACKUP_DATABASE > $BACKUP_DIR/$MYSQL_BACKUP_DATABASE.sqldump || exit 1
|
|
|
|
echo "Mysql database backup finished"
|