Adds LNbits Borg backup module
Implements a new module for backing up LNbits data using Borg. This module automates hourly backups, encrypts the data, and provides point-in-time recovery. It includes scripts for listing, restoring, and mounting backups. A comprehensive setup guide is provided in the documentation. The configuration allows specifying the Borg repository location, schedule, compression settings, retention policy, and SSH key for secure access.
This commit is contained in:
parent
253890ac16
commit
17ac393c32
4 changed files with 1031 additions and 0 deletions
35
config/machines/example-machine/borg-lnbits.nix
Normal file
35
config/machines/example-machine/borg-lnbits.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./modules/lnbits-backup.nix # Add this line
|
||||
];
|
||||
|
||||
# Enable LNbits Borg backup
|
||||
services.lnbits-backup = {
|
||||
enable = true;
|
||||
|
||||
# Repository path - update with your actual path
|
||||
# Option 1: Traditional format
|
||||
# repository = "borg@192.168.1.100:/mnt/my_ssd/borg-backups/lnbits";
|
||||
|
||||
# Option 2: Full SSH URL format (note double slash for absolute path)
|
||||
repository = "ssh://borg@<your-backup-ip>//mnt/borg-backups/lnbits";
|
||||
|
||||
# Backup schedule
|
||||
schedule = "*:0/15"; # Backup schedule (hourly, daily, or systemd timer format)
|
||||
|
||||
# Compression with auto-detection
|
||||
# "auto" skips compression for already-compressed files (images, videos, etc.)
|
||||
compression = "auto,lz4"; # For Raspberry Pi (faster)
|
||||
# compression = "auto,zstd"; # For RockPro64 (better compression)
|
||||
|
||||
# Retention policy, leave all of these
|
||||
retention = {
|
||||
hourly = 24; # Last 24 hours
|
||||
daily = 7; # Last 7 days
|
||||
weekly = 4; # Last 4 weeks
|
||||
monthly = 6; # Last 6 months
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue