Put restic cache on ephemeral disk

This commit is contained in:
IamTheFij 2023-10-23 08:54:05 -07:00
parent 48074bdc39
commit bd2c5ca3db

View File

@ -44,6 +44,11 @@ job "backup%{ if batch_node != null }-oneoff-${batch_node}%{ endif }" {
source = "all-volumes" source = "all-volumes"
} }
ephemeral_disk {
# Try to keep restic cache intact
sticky = true
}
service { service {
name = "backup" name = "backup"
provider = "nomad" provider = "nomad"
@ -84,6 +89,7 @@ job "backup%{ if batch_node != null }-oneoff-${batch_node}%{ endif }" {
"RCLONE_CHECKERS" = "2" "RCLONE_CHECKERS" = "2"
"RCLONE_TRANSFERS" = "2" "RCLONE_TRANSFERS" = "2"
"RCLONE_FTP_CONCURRENCY" = "5" "RCLONE_FTP_CONCURRENCY" = "5"
"RESTIC_CACHE_DIR" = "$${NOMAD_ALLOC_DIR}/data"
} }
template { template {
@ -113,7 +119,6 @@ RCLONE_FTP_NO_CHECK_CERTIFICATE=true
env = true env = true
} }
template { template {
# Build jobs based on node # Build jobs based on node
data = <<EOF data = <<EOF