Last active
December 2, 2021 23:11
-
-
Save ajaegers/92318bdc81541b825c90f265f787e3c8 to your computer and use it in GitHub Desktop.
Simple Certbot (Let's Encrypt) script for auto-renewal certificates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put this file in folder /etc/cron.d/ | |
MAILTO="[email protected]" | |
0 1 * * * root /usr/local/sbin/certbot-renew.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Supposing you have /etc/letsencrypt/cli.ini config file with domains | |
# | |
# Put this script in a daily cron and your cert will be automagically updated 30 days before expiration. | |
# If renew doesn't succeed, you'll receive email notification from your CA. | |
# | |
# https://certbot.eff.org/docs/using.html#renewal | |
# | |
sudo certbot-auto renew --noninteractive --post-hook "service apache2 reload" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes
renew
is better, and usingcertbot-auto
to stay up to date too.Thanks for your reply