Help needed! - Cron job Not working on shared host after EspoCRM Installation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • geonaute
    Junior Member
    • Dec 2021
    • 27

    Help needed! - Cron job Not working on shared host after EspoCRM Installation

    Hi Espocrm Team and users,

    I have just done a fresh installation of Espocrm in a shared host provider.

    All went perfectly except the Cron jobs that we are supposed to add to the crontab file.

    I tried it through SSH with no success and trough the shared host cron jobs.

    Based on the below can you give some tips on what is going wrong in this one? Someone add the same headache as me before.

    Error on SSH:

    -bash-4.2$ crontab -e
    no crontab for u4xxxxxxx


    * * * * * cd /home/uxxxxxxx/domains/xxxxxxxx.com/public_html/crm; /opt/alt/php74/usr/bin/php -f cron.php > /dev/null 2>&1


    Error through the host Cron Jobs as pictures are attached.

    Any guidance is more than welcome.

    Thanks


  • esforim
    Active Community Member
    • Jan 2020
    • 2204

    #2
    What your shared host? Perhaps they got an article on how to add CRON. Here how my one is:
    * * * * * /usr/bin/php /home/username123/public_html/crm/cron.php
    I'm guessing yours would be something like this:

    Using the Screenshot/CPanel instead of SSH

    * * * * * /home/uxxxxxxx/domains/xxxxxxxx.com/public_html/crm/cron.php

    Comment

    • geonaute
      Junior Member
      • Dec 2021
      • 27

      #3
      Hi

      Thank you for your message.
      The shared host is Hostinger.
      I raised a ticket with them, and they were the ones asking me to place it as advised on the snip i sent previously.

      " Hello there, thanks for your patience, now I'm here with you.
      

      At the moment, our hpanel is not able to run cron job with ">".
      So, you may need to add the command until cron.php: /home/user22222/domains/domain.com/public_html/crm; /opt/alt/php74/usr/bin/php -f cron.php
      In order to create custom times for your cron to run you will need to open Hosting → Cron Jobs:
      "

      I have now, based on your example tried the following:
      * * * * * /usr/bin/php /home/u1111111/domains/domain.com/public_html/crm/cron.php
      I am not having the error at Hostinger cron jobs page, however the message on my espocrm did not diasapear from "Schedule jobs"

      How can I confirm the cron job is working? Is there any way to check it?

      Thank you for the support.

      And a side note to espocrm team, this crm is fantastic and very customizable, congrats to the devs of this one!!


      EDIT: It seems it is working... At least per the latest status

      @espcrm Thank you!

      Click image for larger version  Name:	8.png Views:	0 Size:	34.1 KB ID:	77930
      Last edited by geonaute; 12-30-2021, 10:26 PM.

      Comment

      • esforim
        Active Community Member
        • Jan 2020
        • 2204

        #4
        We using the same host then! All is good; just add this line in the HPanel tab, and choose * * * * * for all time setting.

        /home/u1111111/domains/domain.com/public_html/crm/cron.php

        Replace username with your uesrname; of all these part is automatically added or don't need so you don't need to add it yourself (as far as I remember):
        /usr/bin/php
        /opt/alt/php74/usr/bin/php -f cron.php

        Comment

        Working...