Let's Encrypt cron job still gets randomly deleted

I have an issue on multiple FreePBX v15 and v16 where the Let’s Encrypt expires because the cron job that is supposed to renew the certificate gets deleted. This issue has been present for years.

Was a permanent fix ever found for this ?

I still see this as well, every so often.

We use or RMM tool to keep track and send us notification when a cert doesn’t update automatically.

We then manually run the update via CLI.

I asked Gemini for a permanent solution. Here’s what it gave me (I followed the instructions and will see in if works in the future):

Create a dedicated cron job file in /etc/cron.d/. FreePBX does not touch files in this directory.

Steps:

  1. Create a new file for the job:

    Bash

    nano /etc/cron.d/fpbx_cert_fix
    
    
  2. Paste the following content (runs weekly on Sundays at 3:30 AM):

    Bash

    # Permanent Let's Encrypt Renewal Fix
    # Bypasses the unstable FreePBX/Asterisk crontab
    30 3 * * 0 root /usr/sbin/fwconsole certificates --updateall -q > /dev/null 2>&1
    
    
  3. Save and exit (Ctrl+O, Enter, Ctrl+X).

  4. Set the correct permissions:

    Bash

    chmod 644 /etc/cron.d/fpbx_cert_fix
    

Why would you run this weekly? Most have it check daily