Cron job for SSL renew is not working

On EE v4, I use the command "
sudo ee cron create host --command=‘ee site ssl-renew --all’ --schedule=’@weekly’ after create ssl using Let’s encrypt
But it is not working, right now after 90 days the ssl cert had expired

+1 same here

There have been some compete discussions on SSL renewals and cron. Check the link SSL doesnt update.

After the last Easyengine update, this has mostly been fixed on all the sites I use the script on. Have you updated to latest? That may help.

1 Like

I add path like you said. But today I have checked & “This certificate will expire in 14 days.” Well, my ee version is latest (ee 4.1.5)

The cron was supposed to be crontab cron on host system.

Use crontab -e command and add following in the crontab:

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
0 0 * * * /usr/local/bin/ee site ssl-renew --all

Here is a good post on crontab: https://linuxize.com/post/scheduling-cron-jobs-with-crontab/

===

You can delete the cron you you created.

1 Like

can I know how long the cron will be run? 00*** mean daily?

The old path is different without /games:/? Can I know the reason?

I copied the path from PATH variable in the shell.
The values of the variable differ system to system.

can I know how long the cron will be run? 00*** mean daily?

I am not sure how long will it be running. It depends on the number of sites you have. In general, it will get completed within 5-10 minutes, can be more or less.

The cron will run daily, but only request(renew) cert if cert is about to expire in 35 days.

Thank you but 3 days ago I copied your path & edited to run daily but right now, it’s still not working. And I have to run manual for one site. Another site, I have only 19 days left
Today I just edit the path to the old path & change the cron like this
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
0 0 * * * /usr/local/bin/ee site ssl-renew --all

like you said, it will run daily so I have to wait until tomorrow to find out this will work or not

@Anh did it work?

yeah, it works. Amazing. Thank you very much. :sweat_smile: :sweat_smile: :sweat_smile:

1 Like