Created
April 4, 2017 01:44
-
-
Save rankun203/b507d242cd07f090cbb279a423f6f1d6 to your computer and use it in GitHub Desktop.
Backup data to pwd/tar.gz from a container.
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
#!/usr/bin/env bash | |
# | |
# $1: backup filename. | |
# $2: backup target dir. | |
# $3: backup target volumes | |
if [[ "$1" = "-h" ]] | |
then | |
echo '$1: backup filename.' | |
echo '$2: backup target dir.' | |
echo '$3: backup target volumes.' | |
exit | |
fi | |
docker run --rm --volumes-from $3 -v $(pwd):/backup ubuntu tar cvf /backup/$1 $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment