From 2d51b122af30fdcd4e3e4f8a36bd586645a17122 Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Tue, 2 Apr 2024 16:59:48 +0100 Subject: [PATCH] Update backup.sh --- backup.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backup.sh b/backup.sh index dc27cfad..23633092 100755 --- a/backup.sh +++ b/backup.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -SCRIPT_VERSION="31" +SCRIPT_VERSION="32" GREEN='\033[0;32m' YELLOW='\033[1;33m' @@ -14,6 +14,11 @@ if [ $EUID -eq 0 ]; then fi if [[ $* == *--schedule* ]]; then + if ! sudo -n true 2>/dev/null; then + echo -ne "${RED}Error: Passwordless sudo is required for scheduling.${NC}\n" + exit 1 + fi + ( crontab -l 2>/dev/null echo "0 0 * * * /rmm/backup.sh --auto > /dev/null 2>&1"