docker-volume-backup
docker-volume-backup copied to clipboard
Migrate from ubuntu to alpine:3.6
- add build.sh
- migrate to alpine linux, fixed version to 3.6
- fix latest version in shell script
- both, docker container and shell script is migrated to alpine linux
- all changes are tested with a fresh docker installation and an project that contains two named volumes
request was started at #4
add bug fix for line
volumes=($(docker volume ls -f name=$project_name | awk '{if (NR > 1) print $2}'))
the output of an container with two volumes was
# volumes=($(docker volume ls -f name=nextcloud | awk '{if (NR > 1) print $2}'))
# echo $volumes
nextcloud_nextcloud-postgres-data
but there are two volumes
# docker volume ls -f name=nextcloud | awk '{if (NR > 0) print $2}'
VOLUME
nextcloud_nextcloud-postgres-data
nextcloud_postgres-data
after the fix
# declare -a volumes=()
# readarray -t volumes < <(docker volume ls -f name=$project_name | awk '{if (NR > 1) print $2}')
# echo $volumes
nextcloud_nextcloud-postgres-data
nextcloud_postgres-data
add a extended script docker_full_backup.sh for an full backup. For an fast and safe restore the containers should also saved.
- actually backup/restore all containers and volumes
- compressed tar files are ended with .tar.gz
- /backup contains subfolder for containers and volumes
- new script does not collide with old script/data
so, all things should work fine. Please let my know if you found something :)
Cool, thanks :) I'll look into it this week.
Would it be possible to have two different PRs? The first one for switching to alpine and another for adding the full backup functionality?
And since a lot of code of docker_volume_backup.sh seems to be duplicated in docker_full_backup.sh, it might be better to merge the files.
Also please explain to me the use case of docker_full_backup.sh 🙂
sorry, I'm very busy. I will fix and explain that in a week. But thanks for the comments!