I was recently going through my /etc directory and noticed that my /etc/letsencrypt directory was over 1.2Gb in size. I found 154,723 items in both the keys/ and csr/ directories. There are also 1,012 log files in the /var/log/letsencrypt directory. I might be wrong, but this seems a little excessive.
The log files have a consistent line through them:
WARNING:certbot.renewal:Attempting to renew cert (linuxhomeserver.com) from /etc/letsencrypt/renewal/linuxhomeserver.com.conf produced an unexpected error: urn:ietf:params:acme:error:rateLimited :: There were too many requests of a given type.
I had set up a cron in order to renew the cert every two months (* * * */2 * certbot --force-renewal --quiet --agree-tos), but these messages look like it might be running multiple times per hour. What have I done wrong?
My server is an Ubuntu 16.01.6, running Apache 2.4.18 and Certbot 0.31.0.
But the recommended cron schedule is twice a day, at a random hour and minute. This gives it a chance to recover in case of a temporary failure. It's safe to run it that frequently because it will only try to renew certificates that are due for renewal (unless you use --force-renewal, which is why that's a bad idea). But once a minute is a bit too frequent, because it will then retry every minute if it fails.
You’re right thanks, it looks like it was running every minute of every second month. I have changed it to 0 0 1 */2 *. This should run it once every month, as opposed to 2,678,400 times a month!