Cron service active but EspoCRM scheduled jobs still not executing automatically

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CamiReyes
    Junior Member
    • Apr 2025
    • 9

    #1

    Cron service active but EspoCRM scheduled jobs still not executing automatically

    Hi everyone,

    I’m facing an issue where EspoCRM scheduled jobs only run when I manually execute cron.php from SSH, but they do not run automatically via cron every minute.

    Environment:
    • EspoCRM version: 9.1.8
    • PHP: 8.4.10 (CLI)
    • Webserver: LiteSpeed
    • OS: Ubuntu 24.04.3 LTS (Noble Numbat)
    • PHP: 8.4 (CLI)
    • Hosting type: Shared hosting

    What’s working:
    • cron.service is active (running) on the server (recently re-enabled by hosting support).
    • In EspoCRM → Administration → Settings, “Disable Cron” is unchecked.
    • Manually running on the folder that contains EspoCRM:
    /usr/bin/php -f cron.php

    and executes all pending scheduled jobs immediately.



    Current crontab entry (installed under the correct web user):

    * * * * * cd /var/www/c3cbafca-85bc-4004-bc36-e71c2a9aaa2b/public_html; /opt/ecp-php84/bin/php -f cron.php > /dev/null 2>&1

    The problem:
    • Scheduled jobs remain in Pending state unless I run the command manually.
    • The cron_debug.log file does not update when relying on cron.
    • Hosting support confirmed that cron.service is active, but I see no evidence in system logs that the EspoCRM line is being executed per minute.

    What I’ve already checked:
    1. The crontab is installed under the correct user (same one serving the web app).
    2. PHP versions for /usr/bin/php and /opt/ecp-php84/bin/php are identical.
    3. Permissions on the EspoCRM folder and logs are correct for that user.
    4. No “Disable Cron” setting enabled in Espo.
    5. The cron path is absolute (cd into Espo root, then php -f cron.php).


    Thanks in advance for any suggestions. I can provide debug logs or system output if needed.

    Felipe
    ​​
    Last edited by CamiReyes; Today, 05:55 AM.
  • lazovic
    Super Moderator
    • Jan 2022
    • 1142

    #2
    Hi CamiReyes,

    Can you please try to use the following line for the crontab?
    Code:
    * * * * * /opt/ecp-php84/bin/php /var/www/c3cbafca-85bc-4004-bc36-e71c2a9aaa2b/public_html/cron.php
    You can also check with your hosting provider whether it is allowed to run a cron every second, as on shared hostings this is usually prohibited and limited.

    Comment

    Working...