Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
systemd service and timer to stop apache renew letsencrypt certificate and start apache.
[Unit]
Description=Renew Let's Encrypt certificate monthly https://letsencrypt.readthedocs.org/en/latest/using.html#renewal
After=network-online.target
Conflicts=httpd.service
[Service]
Type=oneshot
ExecStart=/usr/bin/certbot certonly renew
ExecStartPost=/usr/bin/systemctl --no-block start httpd
[Unit]
Description=Renew Let's Encrypt certificate monthly https://letsencrypt.readthedocs.org/en/latest/using.html#renewal
[Timer]
OnCalendar=monthly
Persistent=true
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment