Check the remaining validity period of a certificate before renewing.
Shell
Latest commit 30406e5 Jan 28, 2017 @ScottHelme committed on GitHub Merge pull request #5 from byeskille/backup-old-cert-on-renew
Backup old cert on renew
Permalink
Failed to load latest commit information.
LICENSE.md Create LICENSE.md Feb 21, 2016
README.md Update README.md Feb 8, 2016
smartRenew.sh add backup of cert before renew Jan 21, 2017

README.md

Lets-Encrypt-Smart-Renew

Check the remaining validity period of a certificate before renewing.

For further details see my blog post here. The official Let's Encrypt documentation, and my article on Getting started with Let's Encrypt!, recommend calling the renewal script every 30 days. This means there are only 2 opportunities to successfully renew before the certificate expires. Calling the renewal more frequently is wasteful and could cause issues with rate limits depending on your usage.

Let's Encrypt Smart Renew will check the remaining validity period of the certificate before calling your existing renewal script. Once the remaining validity falls below a set threshold, it will action the renewal. This means the script can be called much more frequently.

Replace your existing crontab entry with smartRenew.sh and update it to call your renewal script.

0 * * * * /path/to/smartRenew.sh