diff --git a/backups/backup.nomad b/backups/backup.nomad index 8c1a133..1bb3ec0 100644 --- a/backups/backup.nomad +++ b/backups/backup.nomad @@ -74,14 +74,14 @@ job "backup%{ if batch_node != null }-oneoff-${batch_node}%{ endif }" { image = "iamthefij/restic-scheduler:0.4.2" ports = ["metrics"] args = [ + "--push-gateway", + "http://pushgateway.nomad:9091", %{ if batch_node != null ~} "-once", "-$${NOMAD_META_task}", "$${NOMAD_META_job_name}", "--snapshot", "$${NOMAD_META_snapshot}", - "--push-gateway", - "http://pushgateway.nomad:9091", %{ endif ~} "$${NOMAD_TASK_DIR}/node-jobs.hcl", ] @@ -89,19 +89,29 @@ job "backup%{ if batch_node != null }-oneoff-${batch_node}%{ endif }" { action "unlockenv" { command = "sh" - args = ["-c", "/bin/resticscheduler -once -unlock all $${NOMAD_TASK_DIR}/node-jobs.hcl"] + args = ["-c", "/bin/restic-scheduler -once -unlock all $${NOMAD_TASK_DIR}/node-jobs.hcl"] } action "unlocktmpl" { - command = "/bin/resticscheduler" + command = "/bin/restic-scheduler" args = ["-once", "-unlock", "all", "{{ env 'NOMAD_TASK_DIR' }}/node-jobs.hcl"] } action "unlockhc" { - command = "/bin/resticscheduler" + command = "/bin/restic-scheduler" args = ["-once", "-unlock", "all", "/local/node-jobs.hcl"] } + action "backupall" { + command = "/bin/restic-scheduler" + args = ["-once", "-backup", "all", "/local/node-jobs.hcl"] + } + + action "backupallenv" { + command = "sh" + args = ["-c", "/bin/restic-scheduler -once -backup all $${NOMAD_TASK_DIR}/node-jobs.hcl"] + } + env = { RCLONE_CHECKERS = "2" RCLONE_TRANSFERS = "2"