28 lines
970 B
Bash
Executable File
28 lines
970 B
Bash
Executable File
#!/bin/bash
|
|
# Brain Auto-Test Cron Script
|
|
# Exécuté par cron toutes les heures
|
|
|
|
LOG_FILE="/var/log/brain_auto_test.log"
|
|
API_URL="http://localhost:5821/deliverads/api/brain_test_engine.php"
|
|
|
|
echo "$(date '+%Y-%m-%d %H:%M:%S') - Starting Brain Auto-Test cycle" >> $LOG_FILE
|
|
|
|
# 1. Lancer un cycle de test
|
|
RESULT=$(curl -s -X POST "$API_URL?action=run_cycle" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"batch_size": 30, "priority_isps": ["T-ONLINE", "GMX", "ZIGGO", "GMAIL", "OUTLOOK"]}')
|
|
|
|
echo "$(date '+%Y-%m-%d %H:%M:%S') - Send result: $RESULT" >> $LOG_FILE
|
|
|
|
# 2. Attendre 10 minutes pour la livraison des emails
|
|
sleep 600
|
|
|
|
# 3. Vérifier les seed boxes
|
|
CHECK_RESULT=$(curl -s -X POST "$API_URL?action=check_seeds" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"max_age_minutes": 120}')
|
|
|
|
echo "$(date '+%Y-%m-%d %H:%M:%S') - Check result: $CHECK_RESULT" >> $LOG_FILE
|
|
|
|
echo "$(date '+%Y-%m-%d %H:%M:%S') - Brain Auto-Test cycle completed" >> $LOG_FILE
|