From 932595128c014b2c38d4ac84782ac20643a210c1 Mon Sep 17 00:00:00 2001 From: "Kevin Veen-Birkenbach [aka. Frantz]" Date: Thu, 19 Aug 2021 21:02:52 +0200 Subject: [PATCH] Added draft mysql dump --- README.md | 1 + docker-volume-backup.sh | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index bd4fd14..62458be 100644 --- a/README.md +++ b/README.md @@ -55,3 +55,4 @@ This setup script is not optimized yet for performance. Please optimized this sc ## More information - https://blog.ssdnodes.com/blog/docker-backup-volumes/ - https://www.baculasystems.com/blog/docker-backup-containers/ +- https://hub.docker.com/_/mariadb diff --git a/docker-volume-backup.sh b/docker-volume-backup.sh index 8fc9ed3..1602a0d 100644 --- a/docker-volume-backup.sh +++ b/docker-volume-backup.sh @@ -37,6 +37,10 @@ do rsync -abP --delete --delete-excluded --log-file=$log_path --backup-dir=$raw_backup_dir_path '$source_path/' $raw_destination_path"; done echo "start container: $container_name" && docker start "$container_name"; + if [ "mariadb" == "$(docker inspect --format='{{.Config.Image}}' $container_name)"] + then + docker exec some-mariadb sh -c 'exec mysqldump --all-databases -uroot -p"$MARIADB_ROOT_PASSWORD"' > /some/path/on/your/host/all-databases.sql + fi done echo "end backup routine: $volume_name"; done