add backup box

This commit is contained in:
Yan Lin 2025-12-07 01:58:54 +01:00
parent 4169da9e22
commit a2be1730e9
3 changed files with 34 additions and 12 deletions

View file

@ -17,17 +17,6 @@
];
};
services.scheduled-commands.backup-to-thinkpad = {
enable = true;
description = "Backup files to thinkpad";
interval = "*-*-* 00:00:00";
commands = [
"rsync-backup /mnt/storage/appbulk/immich/library/admin thinkpad:~/Backup/photo-library"
"rsync-backup /mnt/storage/Media/DCIM thinkpad:~/Backup/DCIM"
"rsync-backup /mnt/storage/Media/nsfw thinkpad:~/Backup/nsfw"
];
};
home.packages = with pkgs; [
];

View file

@ -214,7 +214,7 @@
showDiskUsage = true;
diskUsagePaths = [ "/" "/home/" "/mnt/storage" "/mnt/parity" ];
showSnapraidStatus = true;
showBorgStatus = false;
showBorgStatus = true;
};
services.tailscale-custom = {
@ -239,4 +239,30 @@
plex.enable = true;
};
# Borg backup configuration
services.borg-client-custom = {
enable = true;
repositoryUrl = "ssh://backup-box/./hs";
backupPaths = [
"/mnt/storage/appbulk/immich/library/"
"/mnt/storage/Media/DCIM"
"/mnt/storage/Media/nsfw"
];
backupFrequency = "*-*-* 00:00:00";
retention = {
keepDaily = 7;
keepWeekly = 4;
keepMonthly = 6;
keepYearly = 2;
};
passphraseFile = "/etc/borg-passphrase";
preHook = ''
echo "$(date): Starting Borg backup of ${config.networking.hostName}"
'';
postHook = ''
echo "$(date): Borg backup of ${config.networking.hostName} completed successfully"
'';
};
}

View file

@ -54,6 +54,13 @@
identityFile = "~/Credentials/ssh_keys/hetzner";
};
"backup-box" = {
hostname = "u515619.your-storagebox.de";
user = "u515619";
identityFile = "~/Credentials/ssh_keys/hetzner";
port = 23;
};
};
};
}