make rsync work
This commit is contained in:
@@ -43,7 +43,7 @@ in {
|
||||
};
|
||||
offsite_dir = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "blake/archives/homelab";
|
||||
default = "lifeboat";
|
||||
description = "path to rsync offsite backups to";
|
||||
};
|
||||
};
|
||||
@@ -64,10 +64,10 @@ in {
|
||||
systemctl start $(systemctl list-unit-files 'postgresqlBackup-*.service' --no-legend --no-pager | cut -d' ' -f1)
|
||||
'';
|
||||
postHook = ''
|
||||
sshpass -f ${sec."lifeboat_rsync".path} \
|
||||
rsync -aHAX --partial --numeric-ids --info=progress2,name1,stats2 \
|
||||
-e ssh \
|
||||
${cfg.backup_repo} \
|
||||
${pkgs.sshpass}/bin/sshpass -f ${sec."lifeboat_rsync".path} \
|
||||
${pkgs.rsync}/bin/rsync -aHAX --partial --numeric-ids --info=progress2,name1,stats2 --delete \
|
||||
-e "ssh -o StrictHostKeyChecking=no" \
|
||||
${toString cfg.backup_repo} \
|
||||
${cfg.offsite_user}@${cfg.offsite_target}::${cfg.offsite_dir}
|
||||
'';
|
||||
extraArgs = ["--verbose" "--show-rc" "--umask" "0007"];
|
||||
@@ -99,7 +99,7 @@ in {
|
||||
};
|
||||
|
||||
# helpful and for scripts
|
||||
environment.systemPackages = with pkgs; [borgbackup sshpass tree];
|
||||
environment.systemPackages = with pkgs; [borgbackup sshpass tree rsync];
|
||||
|
||||
sops.secrets = {
|
||||
"borg_passwd" = {
|
||||
@@ -109,6 +109,7 @@ in {
|
||||
"lifeboat_rsync" = {
|
||||
owner = "root";
|
||||
group = "archives";
|
||||
mode = "0440";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user