From e8083cbdc4ceafeb05249a50ccbb944fb32b8d8c Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Wed, 17 Apr 2024 11:17:26 +0100 Subject: [PATCH] bin: check for profile presence in backup-restic --- bin/backup-restic | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/backup-restic b/bin/backup-restic index d9333fa..cb9397b 100755 --- a/bin/backup-restic +++ b/bin/backup-restic @@ -23,7 +23,14 @@ fi PROFILE=$1 shift + PROFILE_ROOT=$CONFIG_ROOT/$PROFILE + +if [ ! -d "$PROFILE_ROOT" ] ; then + echo "Profile '$PROFILE' not found in $CONFIG_ROOT" + exit 2 +fi + export RESTIC_PASSWORD_COMMAND="pass restic/$PROFILE/$HOSTNAME" CMDLINE="restic backup --one-file-system --exclude-caches $DRY"