lnd-channels-remote-backup-on-change#270
Conversation
|
how cool ❤️ |
|
@Kukks @NicolasDorier, the cloud backup of SCB from this PR can be integrated with #201 once the storage providers are set and are supported by rclone (currently more that 30). The rclone docker https://hub.docker.com/r/rclone/rclone would probably make more sense in this case. Let me know your thoughts |
lnd-channels-backup-dependencies.sh
Outdated
|
|
||
| # update system | ||
| echo "Updating system" | ||
| apt update && apt upgrade -y && apt autoremove |
There was a problem hiding this comment.
Remove this, thisis not the responsibility of this script.
lnd-channels-backup-dependencies.sh
Outdated
|
|
||
| # generate btcpayserver ssh key | ||
| echo "Generating SSH key" | ||
| ssh-keygen -o -a 100 -t ed25519 -f /root/.ssh/id_ed25519_btcpayserver -N '' |
There was a problem hiding this comment.
name the key better, like lnd_backup
Do not recreate if the key exists.
lnd-channels-backup-dependencies.sh
Outdated
|
|
||
| # install inotify and rsync | ||
| echo "Installing inotify and rsync" | ||
| apt install -y inotify-tools rsync |
There was a problem hiding this comment.
don't install if already installed.
lnd-channels-backup-dependencies.sh
Outdated
|
|
||
| # install rclone | ||
| echo "Installing rclone" | ||
| curl https://rclone.org/install.sh | bash |
There was a problem hiding this comment.
don't install if already installed.
There was a problem hiding this comment.
rsync does the remote server part, rclone does the cloud 'cause it is suited for dealing with all these clouds filesystems, permissions, etc so much better
There was a problem hiding this comment.
rclone has been well maintained, supports 30+ clouds and growing, is regular user-friendly with auto config, has built-in crypt option for advanced users
|
This is a sweet idea, but I think it would be better if that was a docker image instead of separate script setup via systemctl. The main reason is that we could then easily extend for monitoring other folder later, and it does not require modifications on the host. |
|
yes, I agree, already started working on it) |
|
@bereska try to add it to the https://github.com/btcpayserver/dockerfile-deps repo. |
0577568 to
246ee04
Compare
|
@NicolasDorier , just fixed the scripts, working on dockerfile at https://github.com/btcpayserver/dockerfile-deps |
Date: Thu Feb 20 23:16:14 2020 +0300 Committer: bereska <bereska@MacBook-Air-DG-4007.local> Changes to be committed: new file: lnd-channels-backup-dependencies.sh
246ee04 to
d310861
Compare
|
@NicolasDorier , just edited "Do not recreate if the key exists." |
|
@NicolasDorier , hope I didn't miss the point |
Kukks
left a comment
There was a problem hiding this comment.
Hi @bereska, sorry it has taken so long with this PR. While I don't fully understand what this does, it would be better to group these scripts under a directory like Tools/lnd/backup
@bereska, do you think this script still works as-is?
@NicolasDorier Did you have any other objections to this?
@rockstardev Maybe you know better regarding LND functionality?
|
@Kukks hi, my script backs up to remotes lnd channels state on change. It's been successfully running on my rpi 4 with btcpay docker since 2019. But I failed to fully integrate it into docker file correctly as directed by @NicolasDorier |
|
This is a SO required feature. Why is it not being merged since December? Pleaaassseeee :) |
Currently BTCPay Server docker on every change in channels state saves static channels backup (SCB) locally on the same disk (on-site). This poses a threat to LN off-chain funds recovery in case of the server crash or fatal data loss.
Every time a change is made to channel.backup file in BTCPay Server docker it will instantly be copied to set up remotes.
This will allow you to keep the latest SCB offsite (on a remote server and/or popular cloud).
NOTE: this has been tested on Linux systems only.
TO BE CONTINUED ...)