From daf04abedd46b9e40e1acd1634cf313995f6aa99 Mon Sep 17 00:00:00 2001 From: wizzdom Date: Fri, 28 Feb 2025 00:55:56 +0000 Subject: [PATCH] bastion-vm-backup: remove unreliable backups over scp --- jobs/user-vms/bastion-vm-backup.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jobs/user-vms/bastion-vm-backup.hcl b/jobs/user-vms/bastion-vm-backup.hcl index 76d29f3..a0556af 100644 --- a/jobs/user-vms/bastion-vm-backup.hcl +++ b/jobs/user-vms/bastion-vm-backup.hcl @@ -38,7 +38,7 @@ alloc_id=$(nomad job status -verbose bastion-vm | grep running | tail -n 1 | cut job_name=$(echo ${NOMAD_JOB_NAME} | cut -d "/" -f 1) echo "Backing up alloc id: ${alloc_id} on: ${host} to ${path}/${file}..." -scp -B -i {{ key "bastion-vm/service/key" }} {{ key "bastion-vm/service/user" }}@${host}:/opt/nomad/alloc/${alloc_id}/bastion-vm/local/bastion-vm.qcow2 ${path}/${file} +ssh -i {{ key "bastion-vm/service/key" }} {{ key "bastion-vm/service/user" }}@${host} "sudo cat /opt/nomad/alloc/${alloc_id}/bastion-vm/local/bastion-vm.qcow2" > ${path}/${file} find ${path}/bastion-vm-* -ctime +2 -exec rm {} \; || true