docker compose install vs crontab for scheduled jobs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nmincone
    Junior Member
    • Aug 2025
    • 2

    #1

    docker compose install vs crontab for scheduled jobs

    I've spent over 3 hours trying to understand where I went wrong setting up crontab. All my jobs were working before but are no longer. I'm thinking of starting from the beginning.

    I installed via docker compose. Navigated to Administration>Scheduled Jobs.

    Now this is where I get stuck. Another user who was assisting me with this issue on github stated that if I install via docker there is nothing further to do.
    Under scheduled jobs I am instructed to copy and paste this...

    Note: Add this line to the crontab file to run Espo Scheduled Jobs:
    * * * * * cd /var/www/html; /usr/local/bin/php -f cron.php > /dev/null 2>&1

    Do I need to?

    And if so which crontab on my docker host, the one in /etc or right inside the directory where the docker compose file is?

    Very confused and would appreciate any help that can be provided.

    If I follow the instructions here it runs manually.
    Dear EspoCRM Community, Have installed EspoCRM via a docker container as per instructions on here -> https://hub.docker.com/r/espocrm/espocrm Seem to be having a hard time getting the Cron job to work at all due to being within the docker container. is it possible to run the cron.php manually in some way via either web
    Last edited by nmincone; 08-09-2025, 03:56 PM.
  • victor
    Active Community Member
    • Aug 2022
    • 983

    #2
    If you created the docker-compose.yml file according to these instructions https://docs.espocrm.com/administrat...docker-compose, then after installing EspoCRM, you do not need to configure Cron separately, since there is already a Daemon there, which is an alternative to Cron.

    Code:
      espocrm-daemon:
        image: espocrm/espocrm
        container_name: espocrm-daemon
        volumes:
          - espocrm:/var/www/html
        restart: always
        entrypoint: docker-daemon.sh
    More details about Daemon and Cron: https://docs.espocrm.com/administrat...bs/#setting-up.

    Comment


    • nmincone
      nmincone commented
      Editing a comment
      Hi Victor, appreciate your reply! That clarifies it. So it was working for a few days and then stopped. Could it be permissions that is preventiing it from executing?

      -rw-r--r-- 1 nmincone nmincone 1803 Aug 8 22:16 docker-compose.yml
      drwxr-xr-x 11 www-data www-data 4096 Jul 25 08:20 espocrm
      drwxr-xr-x 6 999 systemd-journal 4096 Aug 11 07:30 espocrm-db

      I see this in my logs;
      espocrm-daemon | Instance is not ready: waiting for the installation
      espocrm-daemon | Instance is not ready: waiting for the installation
      espocrm-daemon | Instance is not ready: waiting for the installation
      espocrm-daemon | Instance is not ready: waiting for the installation
      espocrm-daemon | Instance is not ready: waiting for the installation
      espocrm-daemon | Instance is not ready: waiting for the installation
      espocrm-daemon | Instance is not ready: waiting for the installation
      espocrm-daemon | Instance is not ready: waiting for the installation
      espocrm-daemon | Instance is not ready: waiting for the installation
Working...