From 86ed1d74dd7a712900b8f9cd8dda6b7ac688d8d0 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 23 Mar 2021 14:51:57 +1100 Subject: [PATCH] borg-backup-server: set SHELL for verification script In today's weird corner-case issue; when running under cron, SHELL=/bin/sh ... which doesn't really matter (this script is run under #!/bin/bash) *except* that "sudo -s" is obeying SHELL and consequently the in-line script here fails under cron, but not when run interactively. Just set SHELL=/bin/bash for consistency. Change-Id: Ic8584b90fea8382f7a7d294b98a0a3689bfc981b --- .../roles/borg-backup-server/files/verify-borg-backups.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/playbooks/roles/borg-backup-server/files/verify-borg-backups.sh b/playbooks/roles/borg-backup-server/files/verify-borg-backups.sh index 88061e3b2f..7ee1614bd1 100644 --- a/playbooks/roles/borg-backup-server/files/verify-borg-backups.sh +++ b/playbooks/roles/borg-backup-server/files/verify-borg-backups.sh @@ -1,5 +1,9 @@ #!/bin/bash +# When under cron, SHELL can bin /bin/sh which the "sudo -s" below +# obeys. Let's just use bash. +export SHELL=/bin/bash + pushd /opt/backups for u in borg-*; do