lnd-channel-s3-backup/files/lnd-channel-s3-backup.sh
author Luke Hoersten <luke@hoersten.org>
Fri, 15 Sep 2023 22:45:51 -0500
changeset 31 562b76293a66
parent 19 5c8335b57353
permissions -rw-r--r--
Moved lnurld from my general ansible roles repo to the btc specific repo.

#!/bin/bash

BUCKET=$1
CHAN_BACKUP=$2

aws s3 mb "s3://$BUCKET/"
aws s3api put-bucket-versioning --bucket "$BUCKET" --versioning-configuration Status=Enabled

while true; do
    inotifywait $CHAN_BACKUP
    aws s3 cp $CHAN_BACKUP "s3://$BUCKET/"
done