From 71407eb207e9289e22cd325923bb6c96e8b90442 Mon Sep 17 00:00:00 2001 From: NiceDevil Date: Sun, 26 Jan 2025 08:53:48 +0000 Subject: [PATCH] Update Proxmox/pbs_logrotate.sh --- Proxmox/pbs_logrotate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Proxmox/pbs_logrotate.sh b/Proxmox/pbs_logrotate.sh index ea8f85b..f5bd452 100644 --- a/Proxmox/pbs_logrotate.sh +++ b/Proxmox/pbs_logrotate.sh @@ -44,7 +44,7 @@ cron_job="0 3 * * * $cron_command" # Check if a similar cron job exists with a different number of days existing_cron=$(crontab -l 2>/dev/null | grep -F "$cron_command_base") if [[ -n "$existing_cron" ]]; then - existing_days=$(echo "$existing_cron" | grep -oP "\+\d+" | tr -d '+') + existing_days=$(echo "$existing_cron" | grep -oP "\+\d+" | head -n 1 | tr -d '+') if [[ "$existing_days" != "$days_to_keep" ]]; then color_echo "33" "A cron job already exists with $existing_days days." read -p "Do you want to update it to $days_to_keep days? (y/n): " update_confirm