Refactor cron job execution to use separate shell scripts and update process monitoring scripts to correctly handle PID files and log directories. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 7a657272-55ba-4a79-9a2e-f1ed9bc7a528 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: f6d4ec61-7130-41dd-aef9-87b4bc73d0e8 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/449cf7c4-c97a-45ae-8234-e5c5b8d6a84f/7a657272-55ba-4a79-9a2e-f1ed9bc7a528/3R8dKMX
30 lines
833 B
Bash
30 lines
833 B
Bash
#!/bin/bash
|
|
# =========================================================
|
|
# RESTART ALL - Riavvio completo sistema IDS
|
|
# =========================================================
|
|
|
|
LOG_FILE="/var/log/ids/cron.log"
|
|
|
|
echo "$(date): === RESTART SETTIMANALE SISTEMA IDS ===" >> "$LOG_FILE"
|
|
|
|
# Stop all services
|
|
echo "$(date): Arresto servizi..." >> "$LOG_FILE"
|
|
pkill -f "python_ml/main.py"
|
|
pkill -f "vite"
|
|
pkill -f "npm run dev"
|
|
|
|
sleep 5
|
|
|
|
# Clean temp files
|
|
echo "$(date): Pulizia file temporanei..." >> "$LOG_FILE"
|
|
rm -f /var/log/ids/*.pid
|
|
find /tmp -name "ids_*" -mtime +7 -delete 2>/dev/null
|
|
|
|
# Restart services
|
|
echo "$(date): Riavvio servizi..." >> "$LOG_FILE"
|
|
/opt/ids/deployment/check_backend.sh >> "$LOG_FILE" 2>&1
|
|
sleep 3
|
|
/opt/ids/deployment/check_frontend.sh >> "$LOG_FILE" 2>&1
|
|
|
|
echo "$(date): Restart completato!" >> "$LOG_FILE"
|