diff --git a/backup.sh b/backup.sh index f1f50efc..cda39ed5 100755 --- a/backup.sh +++ b/backup.sh @@ -16,6 +16,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"