Skip to content

Czino/lnd-channel-backup-2-mail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

lnd-channel-backup-2-mail

This script watches the LND data folder and sends out emails with the channel backup on changes.

This script is based on https://gist.github.com/alexbosworth/2c5e185aedbdac45a03655b709e255a3

Dependencies

Install mail

sudo apt-get install mailutils inotifywait

Configure mail sudo nano /etc/mailname and add your "domain name" e.g. raspberrypi

Send test email echo "Test" | mail -s "Test" your@email.com

Set it up as a service

  • Create a service file sudo nano /etc/systemd/system/backup-channels.service Content:

    [Service]
    ExecStart=/PATH/TO/copy-channel-backup-on-change.sh
    Restart=always
    RestartSec=60s
    StandardOutput=syslog
    StandardError=syslog
    SyslogIdentifier=backup-channels
    User=USER
    
    [Install]
    WantedBy=multi-user.target
    
  • rename /PATH/TO the the location of shell script

  • replace USER with actual user

  • start and enable service sudo systemctl enable backup-channels.service sudo systemctl start backup-channels.service

Options

The script contains 3 important variables EMAIL, PATHTOLND, PATHTOTMP

EMAIL: your email address

PATHTOLND (default: /home/lightning/.lnd/): the path to your LND data folder

PATHTOTMP (default: /home/lightning/tmp/): the path to folder to temporary store the channel backups

About

Automatically send yourself channel backups via mail

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages