This commit is contained in:
parent
4d7df3a39e
commit
786a6f9f7e
@ -8,6 +8,10 @@ services:
|
||||
- RCLONE_REMOTE=gdrive:/backupTest
|
||||
- RCLONE_CONFIG=/config/rclone.conf
|
||||
- RESTIC_PASSWORD=repopw
|
||||
- MYSQL_USERNAME=dbuser
|
||||
- MYSQL_PASSWORD=dbPassword
|
||||
- MYSQL_DUMP_DB=dbName1,dbName2
|
||||
- MYSQL_HOST=mariadb
|
||||
volumes:
|
||||
- ./mounts:/backup
|
||||
- ./config:/config
|
@ -6,4 +6,11 @@ set -e
|
||||
[ -z "${RCLONE_CONFIG}" ] && echo "\$RCLONE_CONFIG is not set" && exit 1
|
||||
[ -z "${RESTIC_PASSWORD}" ] && echo "\$RESTIC_PASSWORD is not set" && exit 1
|
||||
|
||||
mkdir -p /backup/sqlDump
|
||||
|
||||
for db in ${MYSQL_DUMP_DB//,/ }
|
||||
do
|
||||
mysqldump --compact -P 3306 --host $MYSQL_HOST -u "$MYSQL_USERNAME" "-p$MYSQL_PASSWORD" "$db" > "/backup/sqlDump/$db.sql"
|
||||
done
|
||||
|
||||
restic -r "rclone:$RCLONE_REMOTE" --verbose backup "/backup"
|
||||
|
Loading…
Reference in New Issue
Block a user