Announcement

Collapse
No announcement yet.

Trigger cron.php from outside the system

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trigger cron.php from outside the system

    Hi Forum,

    my client is trying out EspoCRM for his sales person. Since it is a trial, he wanted the CRM to run on his existing shared hosting.

    The problem: The shared hosting only allows a cronjob to run every 2 hours.

    Is there any way to call the cron.php with a service like https://cron-job.org/ ?
    Maybe a customised cron.php in the public folder?

    Thanks in advanced!

  • #2
    A new host would be best but if this is not possible you could create a new end point that calls cron.php via a command line call just make sure you secure it somehow.

    Comment


    • #3
      No. If his host restrict the time of the CRON-job then there no way to go about cheating it with external service. One cheat method that could potential work is, two a duplicate CRON job. Get one on even hours and one on odd hours... that might bypass the 2 hours restriction.

      But this 'tips' is: don't try this at home kids.

      Comment


      • #4
        Originally posted by espcrm View Post
        No. If his host restrict the time of the CRON-job then there no way to go about cheating it with external service. One cheat method that could potential work is, two a duplicate CRON job. Get one on even hours and one on odd hours... that might bypass the 2 hours restriction.

        But this 'tips' is: don't try this at home kids.
        Kiddo tried it at home

        ...and found out, the hosting even had a limit on the max amount of possible cronjobs. So the best I could come up with, is a cronjob every 15min:

        00 0,2,4,6,8,10,12,14,16,18,20,22 * * * /usr/bin/php74 /usr/www/users/ ... /cron.php
        15 0,2,4,6,8,10,12,14,16,18,20,22 * * * /usr/bin/php74 /usr/www/users/ ... /cron.php
        30 0,2,4,6,8,10,12,14,16,18,20,22 * * * /usr/bin/php74 /usr/www/users/ ... /cron.php
        45 0,2,4,6,8,10,12,14,16,18,20,22 * * * /usr/bin/php74 /usr/www/users/ ... /cron.php
        00 1,3,5,7,9,11,13,15,17,19,21,23 * * * /usr/bin/php74 /usr/www/users/ ... /cron.php
        15 1,3,5,7,9,11,13,15,17,19,21,23 * * * /usr/bin/php74 /usr/www/users/ ... /cron.php
        30 1,3,5,7,9,11,13,15,17,19,21,23 * * * /usr/bin/php74 /usr/www/users/ ... /cron.php
        45 1,3,5,7,9,11,13,15,17,19,21,23 * * * /usr/bin/php74 /usr/www/users/ ... /cron.php

        Thanks for pointing me in the right direction

        Comment


        • esforim
          esforim commented
          Editing a comment
          Might want to monitor the CRON for a few days to see if it behaving as expected. Otherwise although CRON might run but the job doesn't get done.

          It like exercising by going for a jog in a game/VR.
      Working...
      X