Jump to content

Cron Job Confusion


borzoid

Recommended Posts

Hi, These are probably stupid questions but here goes.

I'm trying to configure my cron job(s)  and am looking at the docs and different tutorials online. 

  • -Some of the tuts say set the cron to run once daily.  Others say every 5 minutes.
  • -most of the different community posts I see reference 3 cron jobs but I can only find instructions for one.  How many crons am I supposed to have and what are they?
  • -I'm confused about the cron path.  I am using cpanel.  the automation settings page shows this:  
    •         /usr/bin/php -q /home/inpedigr/whmcsdata/crons/cron.php  however all of the tuts I've looked at only show this for the command
    •         php -q /home/inpedigr/whmcsdata/crons/cron.php .    Which is it?

I appreciate any help I can get.  Thank you.

 

Link to comment
Share on other sites

14 minutes ago, borzoid said:

Some of the tuts say set the cron to run once daily.  Others say every 5 minutes.

it depends on your WHMCS version.... older versions only needed to run once per day; recent versions need the cron to run at least hourly, and usually as often as your server can handle.

15 minutes ago, borzoid said:

most of the different community posts I see reference 3 cron jobs but I can only find instructions for one.  How many crons am I supposed to have and what are they?

these days there is usually just one - previously, you needed a separate cron for domain synchronisation (optional).... you might still need another cron if you use POP3 mail importing - but if not, and unless you're using a third-party solution for domain syncing, you should only need the one.

21 minutes ago, borzoid said:

I'm confused about the cron path.  I am using cpanel.  the automation settings page shows this:  

  •         /usr/bin/php -q /home/inpedigr/whmcsdata/crons/cron.php  however all of the tuts I've looked at only show this for the command
  •         php -q /home/inpedigr/whmcsdata/crons/cron.php .    Which is it?

they're the same, it's just a case of knowing the correct path to PHP on your server... your host should be able to tell you which is right for your server setup.

Link to comment
Share on other sites

Thank you for the fast response.   Using "/usr/bin/php -q /home/inpedigr/whmcsdata/crons/cron.php"  is still triggering an error so will change that.  The other settings are for every 5 minutes.  Should I change the run time to try to get this to trigger again?

Link to comment
Share on other sites

9 minutes ago, borzoid said:

Using "/usr/bin/php -q /home/inpedigr/whmcsdata/crons/cron.php"  is still triggering an error so will change that.

https://docs.whmcs.com/Cron_Configuration

CPCron.png

7 minutes ago, borzoid said:

Should I change the run time to try to get this to trigger again?

i'd leave it - most of the tasks in the cron only run once a day anyway (except domain syncing and ticket escalating) - so if you're not using either option, just keep checking the System Health page to see if the cron is running correctly.

also, be aware that you can move the Crons directory so that it's not publicly accessible - if you do this, remember to update your cron path too.

https://docs.whmcs.com/Custom_Crons_Directory

Link to comment
Share on other sites

OK so every 5 minutes I am getting an email that says:

Your WHMCS is configured to perform the Daily System Cron during the hour of 4 am. However, the Daily System Cron did not execute within that hour as expected

Will I continue to get these until 4am?  or is something wrong?  And if I am still getting these after 4am.  Then what do I do?

Link to comment
Share on other sites

21 minutes ago, borzoid said:

I have done this several times.  I don't know what I'm doing wrong.    attached are screen shots of my whmcs automation settings and my cpanel Cron jobs

have you checked with your host that the path to php is correct ? what WHMCS tells me to use in Automation Settings, is not the same as what I actually use - so your host will know best as to the correct path for crons.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated