Comparatif systemd timer vs cron en 2026.
Voir notre guide systemd timers.
| Critère | systemd timer | cron |
|---|---|---|
| Logs | journalctl unifié | /var/log/syslog ou rien |
| Persistent (catch-up) | Oui | Non (anacron séparé) |
| Dépendances | Oui (After=, Requires=) | Non |
| Retry on failure | Oui | Non natif |
| Hardening sécurité | Riche (NoNewPrivileges…) | Limité |
| Limits ressources | Oui | Non |
| Email on failure | OnFailure= unit | MAILTO env |
| Syntaxe | OnCalendar (verbose) | * * * * * (compact) |
| Apprentissage | Modéré | Très facile |
Recommandation
Production sérieuse, multi-services, logs important → systemd timers.
Quick & dirty one-shot scripts perso → cron OK.
Migration cron → systemd
# cron
0 3 * * * /usr/local/bin/backup.sh
# Devient
[Timer] OnCalendar=*-*-* 03:00:00
[Service] ExecStart=/usr/local/bin/backup.sh