Skip to content

Instantly share code, notes, and snippets.

@L30Bola
Last active September 20, 2018 16:40
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 L30Bola/f44e6eb59b71ebde7e2b1e33a7ad1146 to your computer and use it in GitHub Desktop.
Save L30Bola/f44e6eb59b71ebde7e2b1e33a7ad1146 to your computer and use it in GitHub Desktop.

/etc/systemd/system/certbot-renew.timer

[Unit]
Description=Performs periodically, at arbitrary times, verification for renewal of Let's Encrypt certificates

[Timer]
OnCalendar=*-*-* 12,00:00:00
Unit=certbot-renew.service
AccuracySec=1h
RandomizedDelaySec=6h
Persistent=true

[Install]
WantedBy=timers.target

/etc/systemd/system/certbot-renew.service

[Unit]
Description=Renew Let's Encrypt certificates
After=network.target

[Service]
Type=simple
ExecStart=/bin/certbot renew --standalone --pre-hook "systemctl stop httpd && sleep 2" --post-hook "systemctl start httpd"
User=root

[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment