docker-volume-backup icon indicating copy to clipboard operation
docker-volume-backup copied to clipboard

Migrate from ubuntu to alpine:3.6

Open Siassei opened this issue 7 years ago • 5 comments

  • 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

Siassei avatar Nov 18 '17 23:11 Siassei

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

Siassei avatar Nov 19 '17 13:11 Siassei

so, all things should work fine. Please let my know if you found something :)

Siassei avatar Nov 20 '17 12:11 Siassei

Cool, thanks :) I'll look into it this week.

kiview avatar Nov 28 '17 22:11 kiview

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 🙂

kiview avatar Nov 28 '17 23:11 kiview

sorry, I'm very busy. I will fix and explain that in a week. But thanks for the comments!

Siassei avatar Nov 30 '17 22:11 Siassei