Created
July 28, 2022 00:06
-
-
Save clintkev251/0bfcc4e7e552addc14084b9faf4de1ba to your computer and use it in GitHub Desktop.
Generic backup script which stops and restarts containers
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
#!/bin/bash | |
echo "-----Stopping containers-----" | |
docker stop $(docker ps -q) | |
echo "-----Creating archive-----" | |
tar -cf stacks.tar stacks | |
echo "-----Restarting containers-----" | |
docker start $(docker ps -a -q) | |
echo "-----Uploading backup-----" | |
rclone sync stacks.tar backblaze:some-bucket | |
echo "-----Upload complete, cleaning up-----" | |
rm stacks.tar | |
curl https://status.example.com/api/push/example?status=up |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment