Add push gateway and tasks for running backups on system backup jobs
This commit is contained in:
parent
ae6fe918ef
commit
b6605aa8bc
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user