diff options
author | Christian Pointner <equinox@spreadspace.org> | 2022-01-11 00:19:35 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2022-01-11 00:19:35 +0100 |
commit | 9dd9c2ec2e0e0f34db95d9650ea253c147f8c7d3 (patch) | |
tree | 99c7953dea546113ba85bcb6da56d7d6b688a6eb /roles/storage/zfs/syncoid/templates/syncoid_pull.j2 | |
parent | zfs/syncoid: add error handling to pull (diff) |
zfs/syncoid: add duration of job to prometheus metrics
Diffstat (limited to 'roles/storage/zfs/syncoid/templates/syncoid_pull.j2')
-rw-r--r-- | roles/storage/zfs/syncoid/templates/syncoid_pull.j2 | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/roles/storage/zfs/syncoid/templates/syncoid_pull.j2 b/roles/storage/zfs/syncoid/templates/syncoid_pull.j2 index ab6c3116..d54683c5 100644 --- a/roles/storage/zfs/syncoid/templates/syncoid_pull.j2 +++ b/roles/storage/zfs/syncoid/templates/syncoid_pull.j2 @@ -16,6 +16,12 @@ if [ -n "$1" ]; then shift fi +if [ -n "$RUNTIME_DIRECTORY" ]; then + if [ ! -e "$RUNTIME_DIRECTORY/start" ]; then + date +"%s" > "$RUNTIME_DIRECTORY/start" + fi +fi + /usr/sbin/syncoid --sshoption "UserKnownHostsFile=/var/lib/syncoid/ssh.knownhosts" --sshoption "HashKnownHosts=no" --sshkey "/var/lib/syncoid/id_ssh_ed25519" --no-sync-snap --compress zstd-fast "$@" "$src_host:$src_path" "$dest_path" ret=$? |