diff options
author | Kjetil Orbekk <kj@orbekk.com> | 2021-03-11 08:03:28 -0500 |
---|---|---|
committer | Kjetil Orbekk <kj@orbekk.com> | 2021-03-11 08:03:28 -0500 |
commit | 00683d781c7604297c04770ee0c1669c2c255ffc (patch) | |
tree | 1858b68b32ee6d0d42ace12817acb7fc7d602538 | |
parent | f744d9efe86848243c584a7042b90378d51e9a63 (diff) |
update prober
-rw-r--r-- | config/borg-backup.nix | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/config/borg-backup.nix b/config/borg-backup.nix index 5b45358..3a6fd7b 100644 --- a/config/borg-backup.nix +++ b/config/borg-backup.nix @@ -56,13 +56,20 @@ in systemd.services.backup-prober = { description = "Find latest backup probe timestamp."; - path = with pkgs; [ borgbackup rsync openssh moreutils ]; + path = with pkgs; [ borgbackup rsync openssh sshfs moreutils ]; startAt = "06:30"; + serviceConfig = { + RuntimeDirectory = "backup-prober"; + }; environment = { - BORG_KEYS_DIR = "/opt/secret/borg-backup-keys/"; - REPOSITORY = repo; + BORG_KEY_FILE = "/opt/secret/borg-backup-keys/staging_backup"; + BORG_RELOCATED_REPO_ACCESS_IS_OK = "yes"; }; script = '' + mkdir "$RUNTIME_DIRECTORY/mnt" + sshfs root@orbekk.osl.trygveandre.net:/storage "$RUNTIME_DIRECTORY/mnt" + REPOSITORY="$RUNTIME_DIRECTORY/backup" + last_repo="$(borg list $REPOSITORY -P ${probe.repo} --last 1 --short)" target="${config.orbekk.monitoring-server.textFileDir}/backup_probe.prom" timestamp=$(borg extract --stdout $REPOSITORY::"$last_repo" "${probe.repo_path}") |