lnd-channel-s3-backup/files/lnd-channel-s3-backup.sh
changeset 19 5c8335b57353
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lnd-channel-s3-backup/files/lnd-channel-s3-backup.sh	Mon Jul 05 10:46:30 2021 -0500
@@ -0,0 +1,12 @@
+#!/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