My certificate never refreshes automatically


#1

Every 3 months I have to do the renewal of the certificate manually because it is not doing this automatically and I do not know for what reason.

Someone could tell me why this happens.

Thank you!

Hello,

Your certificate (or certificates) for the names listed below will expire in
10 days (on 17 Jun 18 13:23 +0000). Please make sure to renew
your certificate before then, or visitors to your website will encounter errors.

#2

Are your cronjobs running as expected?


#3

Yes it seems like everything works fine!


#4

It seems you need a careful debugging on your cronjobs.

Anyways, try using this script to renew your LE certificates (no warranties, of course, and the risks are up to you):

#!/bin/bash

green='\e[0;32m'
red='\e[1;31m'
endColor='\e[0m'


for DOM in `ee site list | grep -v example.com | sort | sed 's/\x1B\[[0-9;]*[JKmsu]//g'`;
do
	echo -e "${green}Renewing:${endColor} $DOM \n\n\n"
	ee site update $DOM --le=renew
done

ee clean --all
nginx -t && service nginx reload

#5

Add a ‘sudo’ to the instructions for renewal in your cron job.


#6

EEv3, as far as I know, is meant to be run by root user. Thus, no need for sudo.


#7

To renew I use this code

sudo /opt/letsencrypt/certbot-auto renew

it works very well. My problem is automatic renewal, I do not know why it does not.


#8

I use this code it works great for manual renewal
sudo / opt / letsencrypt / certbot-auto renew


#9

This is my cron

0 0 * * 0 ee site update --le=renew --all 2> /dev/null

it does not automatically update I still have to update manually.