Trying to make a Cronjob for updating SSL but it does not work

I have this cronjob made to try and update our SSL certificates automatically but it does not seem to work, any advice on how to troubleshoot this? As far as I can tell it has correct syntax but I’m not an expert in cronjobs. Any help would be appreciated thanks!

31 2 * * * fwconsole certificate --updateall >/dev/null 2>&1

How are you generating your certificates and where are they created ?

Let’s encrypt and I’m doing it via the free PBX gui system admin, and the command fwconsole certificate --updateall

Is FreePBX not doing it automatically for you already?

Then why did you think that would be necessary ?

Well that’s the thing, they won’t update automatically, so I have to run that command every time I want to update the certificates. So I was hoping I could get a cronjob to run it automatically for me. Would the ports have anything to do with that?

Yea, your LetsEncrypt port is set to Disabled. Not sure that running it manually would work either with that set to Disabled.

Change that to port 80 and see if it’ll automatically do it for you.

I’ve given it some time with that port open and it still has not updated the certificate.

If you run it manually from CLI with fwconsole certificate --updateall?

If it does then you just need to let it go to see if it’ll work once the next renewal period comes around.

Yeah that’s how I’ve been updating them so far is with fwconsole certificate --updateall and it works fine, I’m just trying to find a way where I don’t have to do that every time it needs an update

Cron runs by default in a restricted environment and the PATH might not find fwconsole, you will need to call /usr/sbin/fwconsole to be sure,
(and probably best done in the asterisk ‘user’ cron tab so it’s the same as the gooey.)(

Thanks, I’m gonna give that a shot will report back on if it works

Try deleting the ssl cert and recreating it. I’ve seen that fix the auto update problem.

Thanks everyone, I figured it out the PBX I was working on was having a DNS issue so after fixing it and trying it on another PBX it worked just fine

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.