Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Unit]
Description=bitconid Backup
Requires=docker.service
[Service]
TimeoutStartSec=0
ExecStartPre=-/bin/docker pull abcrawf/awscli
ExecStartPre=-/bin/docker pull abrkn/bitcoind
ExecStart=/bin/bash -c "\
docker run \
--rm \
--name bitcoind-backup \
--link bitcoind:bitcoind \
abrkn/bitcoind \
/usr/bin/bitcoind \
--rpcconnect=bitcoind \
--rpcuser=username \
--rpcpassword=password \
backupwallet /data/wallet.dat.backup && \
docker run \
--rm \
--name bitcoind-ebs-snapshot \
--env AWS_ACCESS_KEY_ID=$(etcdctl get /aws_key) \
--env AWS_SECRET_ACCESS_KEY=$(etcdctl get /aws_secret) \
--env AWS_DEFAULT_REGION=eu-west-1 \
abcrawf/awscli \
ec2 create-snapshot \
--volume-id $(etcdctl get /bitcoind/volume_id) \
--description bitcoind-data-backup \
"
[Install]
WantedBy=multi-user.target
[X-Fleet]
MachineOf=bitcoind.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.