Skip to content

Instantly share code, notes, and snippets.

@geoorgeous
Last active July 23, 2019 15:17
Show Gist options
  • Save geoorgeous/9829240bd3cd7ad65e0b070fc7f2f5dd to your computer and use it in GitHub Desktop.
Save geoorgeous/9829240bd3cd7ad65e0b070fc7f2f5dd to your computer and use it in GitHub Desktop.
crontab file edit for certbot auto renewal twice a day (00:00 and 12:00). Also restarts specified web server service upon completing the certificate renewal. Currently using on *and only tested on* my RaspberryPi Raspbian Apache2 web server
# This line of text should be included in your crontab file which can be edited by
# running the following command:
# sudo crontab -e
# SERVER_SERVICE should be replaced with whatever service is running your web server,
# for example 'apache2' or 'nginx'
0 */12 * * * root certbot renew --post-hook "service SERVER_SERVICE restart"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment