Documentation
Cron-Ping fonctionne sur un principe simple : ton script appelle une URL après chaque exécution. Si l'appel n'arrive pas à temps, on t'alerte. Aucune librairie à installer.
Les trois types de ping
- Succès —
GET https://cron-ping.com/p/<token>: la tâche s'est exécutée correctement. - Démarrage —
GET https://cron-ping.com/p/<token>/start: appelé en début de tâche, mesure la durée. - Échec —
GET https://cron-ping.com/p/<token>/fail: la tâche a planté, déclenche une alerte immédiate.
Exemple avec curl
# Ping de succès (le plus courant)
curl -fsS https://cron-ping.com/p/<token>
# Encadrer une commande : start, puis succès ou échec
curl -fsS https://cron-ping.com/p/<token>/start
if /opt/mon-script.sh; then
curl -fsS https://cron-ping.com/p/<token>
else
curl -fsS https://cron-ping.com/p/<token>/fail
fiDans une crontab
# tous les jours à 3h, ping seulement si le script réussit
0 3 * * * /opt/backup.sh && curl -fsS https://cron-ping.com/p/<token>Capturer les logs (debug post-mortem)
Envoie la sortie de ta commande en POST : on conserve les 1000 derniers caractères.
m=$(/opt/mon-script.sh 2>&1) && curl -fsS --data-raw "$m" https://cron-ping.com/p/<token>Avec wget
wget -q -O /dev/null https://cron-ping.com/p/<token>En Python
import urllib.request
urllib.request.urlopen("https://cron-ping.com/p/<token>", timeout=10)Dans un Dockerfile / healthcheck
HEALTHCHECK CMD curl -fsS https://cron-ping.com/p/<token> || exit 1Surveille cette tâche en 2 minutes avec Cron-Ping
Commencer gratuitement