Files
turf_saas/run_pmu_range.sh
2026-04-25 17:18:43 +02:00

34 lines
747 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# Début et fin
START="2026-01-01"
END="2026-03-21"
# Conversion en timestamps
start_ts=$(date -d "$START" +%s)
end_ts=$(date -d "$END" +%s)
echo "=== Lancement PMU du $START au $END ==="
current_ts=$start_ts
while [ $current_ts -le $end_ts ]; do
# Format JJMMAAAA
DATE=$(date -d "@$current_ts" +%d%m%Y)
echo "----------------------------------------"
echo "📅 Traitement date : $DATE"
echo "----------------------------------------"
# Exécution de la commande
python3 /home/h3r7/turf_scraper/pmu_results.py --date "$DATE" 2>&1 | head -60
# Pause légère pour éviter de spammer lAPI
sleep 1
# Date suivante
current_ts=$(( current_ts + 86400 ))
done
echo "=== Terminé ==="