A few days ago, I received an email from LetsEncrypt letting me know that it was time to renew my free SSL certificates.
I tried re-running the tool in order to renew the certificates which seemed to work, but then I received this email;
It seems my attempt to use the same tool to renew was not the correct way to go about it. I went looking for tutorials online and eventually found the command letsencrypt-auto renew
. It seems too easy! It took just a few seconds to renew all the certs that were going to expire.
Official Documentation suggests using the following script to automate this process;
#!/bin/sh
if ! /path/to/letsencrypt-auto renew > /var/log/letsencrypt/renew.log 2>&1 ; then
echo Automated renewal failed:
cat /var/log/letsencrypt/renew.log
exit 1
fi
apachectl graceful
I created this bash script and added it to the crontab with 0 0 * * 0 root bash /root/letsencrypt/maybe_renew.sh
Now it should be checking automatically on a weekly basis!