backup-docker/backup.sh

16 lines
328 B
Bash
Raw Normal View History

2021-11-10 20:27:49 +00:00
#!/usr/bin/env sh
set -e
. /app/setup.sh
mkdir -p /backup/sqlDump
for db in $(echo "$MYSQL_DUMP_DB" | sed 's/,/\n/g')
do
echo "Dumping db: $db"
mysqldump --compact -P 3306 --host "$MYSQL_HOST" -u "$MYSQL_USERNAME" "-p$MYSQL_PASSWORD_ACTUAL" "$db" > "/backup/sqlDump/$db.sql"
done
restic --verbose backup "/backup"