Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente Prochaine révision Les deux révisions suivantes | ||
linux:systemd [15-05-2017 11:19] edmc73 créée |
linux:systemd [15-05-2017 11:24] edmc73 |
||
---|---|---|---|
Ligne 4: | Ligne 4: | ||
Lister les timers | Lister les timers | ||
systemctl list-timers --all | systemctl list-timers --all | ||
+ | |||
+ | Exemple d'un timer | ||
+ | |||
+ | certbot.timer will execute the certbot.service at 12 am and 12 pm. | ||
+ | |||
+ | <code bash> | ||
+ | # cat / | ||
+ | [Unit] | ||
+ | Description=Run certbot twice daily | ||
+ | |||
+ | [Timer] | ||
+ | OnCalendar=*-*-* 00,12:00:00 | ||
+ | RandomizedDelaySec=3600 | ||
+ | Persistent=true | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=timers.target | ||
+ | </ | ||
+ | |||
+ | and certbot.service will execute the renew command. | ||
+ | |||
+ | |||
+ | <code bash> | ||
+ | # cat / | ||
+ | [Unit] | ||
+ | Description=Certbot | ||
+ | Documentation=file:/// | ||
+ | Documentation=https:// | ||
+ | [Service] | ||
+ | Type=oneshot | ||
+ | ExecStart=/ | ||
+ | PrivateTmp=true | ||
+ | </ |