Skip to content

Instantly share code, notes, and snippets.

@dcode
Created September 18, 2018 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcode/11129baa54c6ba38facdf99011088379 to your computer and use it in GitHub Desktop.
Save dcode/11129baa54c6ba38facdf99011088379 to your computer and use it in GitHub Desktop.
Run certbot twice daily to ensure we never lose a valid cert.
# /etc/systemd/system/certbot.service
[Unit]
Description=Certbot Renewal
[Service]
ExecStart=/usr/bin/certbot renew --post-hook "systemctl restart httpd"
# /etc/systemd/system/certbot.timer
[Unit]
Description=Run certbot twice daily
[Timer]
OnCalendar=*-*-* 00,12:00:00
RandomizedDelaySec=3600
Persistent=true
[Install]
WantedBy=timers.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment