Outils pour utilisateurs

Outils du site


tech:notes_systemd_timer

Ceci est une ancienne révision du document !


Notes SystemD Timer

Désactiver tous les timers

Très utile après un ntpdate. Dans le cas contraire SystemD pourrait lancer d'un coups tous les timers !

systemctl list-timers --no-block --read-only --state active --output json | jq '.[].unit' | xargs systemctl stop 
 
# Vérif :
systemctl list-timers --no-block --read-only --state active 

Autres

systemctl stop logrotate.timer
systemctl disable logrotate.timer
touch /var/lib/systemd/timers/stamp-logrotate.timer
systemctl clean --what=state logrotate.timer
systemctl enable logrotate.timer
systemctl daemon-reload
systemctl reload-or-restart logrotate.timer

Exemples

atop-rotate

/usr/lib/systemd/system/atop-rotate.service

[Unit]
Description=Restart atop daemon to rotate logs
 
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl try-restart atop.service

/usr/lib/systemd/system/atop-rotate.timer

[Unit]
Description=Daily atop restart
 
[Timer]
OnCalendar=daily
 
[Install]
WantedBy=timers.target

Autres

systemctl list-timers --all --state bad
systemctl list-timers --all --state bad-setting
systemctl list-timers --all --state error
systemctl list-timers --all --state failed

FIXME

tech/notes_systemd_timer.1789465841.txt.gz · Dernière modification : de Jean-Baptiste

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki