Last active
June 28, 2023 09:52
-
-
Save mrtnvgr/1645cadbc21f97c305b70efb388bae2f to your computer and use it in GitHub Desktop.
Backup Docker volumes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for VOLUME in $@; do | |
docker volume inspect $VOLUME >/dev/null && \ | |
docker run --rm -v $VOLUME:/_data -v $PWD:/backup busybox tar czf backup/$VOLUME.tar.gz _data && \ | |
echo "OK: $VOLUME" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment