Skip to content

Instantly share code, notes, and snippets.

@mysticaltech
Last active December 3, 2018 00:37
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 mysticaltech/4adea4c15a2b1147f0be49ea7ff41b92 to your computer and use it in GitHub Desktop.
Save mysticaltech/4adea4c15a2b1147f0be49ea7ff41b92 to your computer and use it in GitHub Desktop.
Automatically renew Certbot certificate using cron
sudo crontab -e
# And copy paste:
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(3600))' && certbot -q renew
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment