Skip to content

Instantly share code, notes, and snippets.

@skwp
Created October 26, 2018 18:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skwp/40372e775dd291f78072e26c46939494 to your computer and use it in GitHub Desktop.
Save skwp/40372e775dd291f78072e26c46939494 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
BUCKET=our.s3.bucket.com
DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
docker stop bitcoin
tar --exclude='.lock' --exclude='debug.log' --exclude='peers.dat' --exclude='banlist.dat' -czvf /tmp/bitcoin.tgz /var/bitcoin/
/usr/local/bin/aws s3 cp /tmp/bitcoin.tgz s3://$BUCKET/bitcoin-backups/$DATE/$(hostname)/bitcoin.tgz
docker start bitcoin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment