Last active
March 31, 2020 01:56
-
-
Save timothystewart6/9614ed304b717fa319deb720930ac9b4 to your computer and use it in GitHub Desktop.
A script to back up your rancher 2 installation with docker
This file contains 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
docker stop rancher_docker_server | |
docker create --volumes-from rancher_docker_server --name rancher-data-"$(date +%F)" rancher/rancher:latest | |
docker run --volumes-from rancher-data-"$(date +%F)" -v $PWD:/backup:z busybox tar pzcvf /backup/rancher-data-backup-latest-"$(date +%F)".tar.gz /var/lib/rancher | |
docker rm rancher-data-"$(date +%F)" | |
docker start rancher_docker_server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment