From a00868515f87a800c7d06c0e5ec3996188b0590e Mon Sep 17 00:00:00 2001 From: infosave2007 Date: Mon, 10 Nov 2025 16:29:04 +0300 Subject: [PATCH] feat: add cron configuration check in container and log status --- update.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/update.sh b/update.sh index b625900..f49314e 100755 --- a/update.sh +++ b/update.sh @@ -612,8 +612,19 @@ fi log "" log "${BLUE}[9/10] Restarting containers...${NC}" +# Check if cron is configured in container +log_info "Checking cron configuration..." +CRON_CONFIGURED=$($DOCKER_COMPOSE exec -T web test -f /etc/cron.d/amnezia-cron && echo "1" || echo "0") + +if [ "$CRON_CONFIGURED" = "0" ]; then + log_warning "Cron not configured in container, rebuilding required..." + DOCKERFILE_CHANGED=1 +else + log_success "Cron is configured" + DOCKERFILE_CHANGED=0 +fi + # Check if Dockerfile was modified -DOCKERFILE_CHANGED=0 if [ "$CURRENT_COMMIT" != "$NEW_COMMIT" ]; then if git diff --name-only "$CURRENT_COMMIT" "$NEW_COMMIT" 2>/dev/null | grep -q "Dockerfile\|bin/monitor_metrics.sh\|bin/collect_metrics.php"; then DOCKERFILE_CHANGED=1