This commit is contained in:
Lukas Wurzinger 2025-01-05 01:06:14 +01:00
parent c99999ce28
commit 1d41e38765
No known key found for this signature in database
2 changed files with 6 additions and 4 deletions

View file

@ -20,9 +20,9 @@ in {
description = "Local rsync Backup ${backupName}";
wantedBy = ["timers.target"];
timerConfig = {
OnCalendar = "*-*-* 03:00:00";
OnCalendar = "*-*-* 03:00:00"; # TODO
Persistent = true;
Unit = "${systemdName}.service";
Unit = "${systemdName}.service"; # TODO
};
};
@ -33,6 +33,7 @@ in {
User = "root";
Group = "root";
};
# TODO
script = ''
${lib.getExe pkgs.rsync} --verbose --verbose --archive --update --delete --mkpath -- ${backups.${backupName}}/ /srv/backup/${backupName}/
'';
@ -52,7 +53,7 @@ in {
passwordFile = config.age.secrets."restic-${attrName}".path;
pruneOpts = ["--keep-daily 7" "--keep-weekly 5" "--keep-monthly 12"];
timerConfig = {
OnCalendar = "*-*-* 03:00:00";
OnCalendar = "*-*-* 03:00:00"; # TODO
Persistent = true;
};
extraOptions = ["sftp.args='-i /etc/ssh/ssh_host_ed25519_key -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'"];

View file

@ -15,6 +15,7 @@
post = let
remoteDir = self.nixosConfigurations.abacus.config.services.navidrome.settings.MusicFolder;
rsyncExe = lib.getExe pkgs.rsync;
rsh = "${lib.getExe pkgs.openssh} -i /etc/ssh/ssh_host_ed25519_key -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null";
in ''
${rsyncExe} \
--archive \
@ -24,7 +25,7 @@
--mkpath \
--verbose --verbose \
--exclude lost+found \
--rsh 'ssh -i /etc/ssh/ssh_host_ed25519_key -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' \
--rsh ${lib.escapeShellArg rsh} \
/srv/compmusic/ root@wrz.one:${remoteDir}
'';
};