Skip to content

Instantly share code, notes, and snippets.

Last active May 7, 2017
What would you like to do?
arch linux增加定式任务

在 Arch Linux 上,我们通过 systemd 来自动执行证书续期任务。

$ sudo vim /etc/systemd/system/letsencrypt.service
Description=Let's Encrypt renewal

ExecStart=/usr/bin/certbot renew --quiet --agree-tos  
ExecStartPost=/bin/systemctl reload nginx.service  
然后增加一个 systemd timer 来触发这个服务:

$ sudo vim /etc/systemd/system/letsencrypt.timer
Description=Monthly renewal of Let's Encrypt's certificates


启用服务,开启 timer:

$ sudo systemctl enable letsencrypt.timer
$ sudo systemctl start letsencrypt.timer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment