Added draft mysql dump

This commit is contained in:
Kevin Veen-Birkenbach 2021-08-19 21:02:52 +02:00
parent 5cc5a6e5e5
commit 932595128c
2 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -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