Created
January 28, 2026 14:23
-
-
Save costa/805b85bb00516c54cf9517f3cec49af9 to your computer and use it in GitHub Desktop.
Clone a docker volume for fun and profit (stopping attached containers, if needed for data integrity, is on you)
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/bash -e | |
| test "$#" -ne 2 && echo "USAGE ...docker-volume-clone <OLD> <NEW>" >&2 && exit 145 | |
| cd "$( dirname "${BASH_SOURCE[0]}" )"/.. | |
| docker volume create --name "$2" | |
| docker run --rm -v "$1:/from" -v "$2:/to" eeacms/rsync rsync -a /from/ /to/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment