Created
June 17, 2026 02:33
-
-
Save oanhnn/113b03fca0d4aab63e2b9689583e3b38 to your computer and use it in GitHub Desktop.
Backup docker volume
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 | |
| DOCKER_VOLUMN_NAME=$1 | |
| docker run --rm \ | |
| -v $DOCKER_VOLUMN_NAME:/data \ | |
| -v $(pwd):/backup \ | |
| alpine tar czf /backup/$DOCKER_VOLUMN_NAME-$(date +%Y%m%d).tar.gz -C /data . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment