systemd: add units for a service and timer
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
f8a6a4deca
commit
082a4cb672
3 changed files with 21 additions and 0 deletions
|
@ -64,3 +64,9 @@ Whether you use a cronjob or a systemd timer, you can chain this command to a da
|
|||
```shell
|
||||
too-soon pem "fullchain.pem" || mail -s "$(shell hostname): certificates expire soon" webmaster@example.com
|
||||
```
|
||||
|
||||
## `systemd` units
|
||||
|
||||
Copy the `too-soon-remote@.service` and `too-soon-remote@.timer` to `/etc/systemd/system/` after making sure the path to the `too-soon` binary is correct (preset as `/usr/local/bin/too-soon`).
|
||||
Then `systemct enable --now too-soon-remote@example.com.timer`.
|
||||
|
||||
|
|
5
too-soon-remote@.service
Normal file
5
too-soon-remote@.service
Normal file
|
@ -0,0 +1,5 @@
|
|||
[Unit]
|
||||
Description=check domain's certificate expiration and alert if expires within 20d
|
||||
|
||||
[Service]
|
||||
ExecStart="/usr/local/bin/too-soon" "-D" "remote" "%i"
|
10
too-soon-remote@.timer
Normal file
10
too-soon-remote@.timer
Normal file
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Description=check domain's certificate expiration and alert if expires within 20d
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*-*-* 6:00
|
||||
RemainAfterElapse=no
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue