From 83240a5bc4fe2f215bf6e2fec40a019dfcc429a2 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sun, 6 Jul 2025 13:07:31 +0200 Subject: [PATCH] Added a check not to backup the root directory --- restic-auto/restic-auto | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/restic-auto/restic-auto b/restic-auto/restic-auto index 2061e90..27f94b9 100755 --- a/restic-auto/restic-auto +++ b/restic-auto/restic-auto @@ -3,7 +3,10 @@ # Backup one directory function backup_dir { # Check if the dir to backup is mounted as a subdirectory of /root inside this container - if [ -d "/root_fs$1" ]; then + if [ "$1" = "" ]; then + echo "[ERROR] Cannot backup the root directory. Have you correctly configured the volumes to backup for this container ?" + return -1 + elif [ -d "/root_fs$1" ]; then restic backup $RESTIC_BACKUP_FLAGS /root_fs$1 return $? else