4

I need some help setting up my crontab for SugarCRM.

My SugarCRM log just looks like this:

Wed Aug 21 10:36:02 2013 [5145][1][FATAL] Job runs too frequently, throttled to protect the system.
Wed Aug 21 10:37:01 2013 [5156][1][FATAL] Job runs too frequently, throttled to protect the system.
Wed Aug 21 10:38:02 2013 [5181][1][FATAL] Job runs too frequently, throttled to protect the system.
Wed Aug 21 10:39:02 2013 [5196][1][FATAL] Job runs too frequently, throttled to protect the system.

I run crontab -e and this is what I have in it:

*    *    *    *    *     cd /var/www/sugarcrm; php -f cron.php > /dev/null 2>&1

I have my "Run Mass Email Campaigns" job running once an hour. My campaign emails aren't being sent. I can send them if I go into the Email Queue and click the Send Queued Campaign Email button, but even then it only sends out about 500. I have about 50,000 to send out lol. Any help with the crontab is greatly appreciated.

dkeeper09
  • 537
  • 3
  • 11
  • 29

2 Answers2

3

To make it upgrade safe just add this to your config_overrite.php

$sugar_config['cron']['min_cron_interval'] = 0;
pepper
  • 1,732
  • 2
  • 17
  • 33
2

OK, The problem is that you are running the cron every minute, and it used to work that way fine. It still does sort of. They just found that it was bogging down systems too much, a new instance of the scheduler would start to run while the last one was still running.

so you have 2 choices

1) run the cron every 30 minutes. This should make that warning go away

2) Edit the file include/SugarQueue/SugarCronJobs.php and change the variable

    public $min_interval = 30;

to

    public $min_interval = 0;

This, of course, will not be upgrade safe but it is perfectly OK to do. You just have to make sure you update the file every time your instance is upgraded.

Ken Brill
  • 91
  • 1
  • Ok, I tried those. So I created a new Cron Job, just to see what happens. When I created it, I got this in my log: `Wed Aug 21 14:11:02 2013 [27141][1][FATAL] Job 90bc928e-2203-e15d-0126-52152c80e7aa (Send Emails) failed in CRON run ` – dkeeper09 Aug 21 '13 at 21:17
  • Not enough info there to diagnose this one. Check your apache logs and see if there is any wisdom there. – Ken Brill Aug 21 '13 at 21:29
  • Ok, so I looked in my apache error log and found this: `MYPUBLICIP - - [21/Aug/2013:14:52:01 -0700] "GET /sugarcrm/cron.php HTTP/1.1" 200 215 "-" "curl/7.21.6 (x86_64-pc-linux-gnu) libcurl/7.21.6 OpenSSL/1.0.0e zli b/1.2.3.4 libidn/1.22 librtmp/2.3" ` – dkeeper09 Aug 21 '13 at 21:53
  • I also tried both of your suggestions above and still getting the same error. Could it be anything else causing it? – dkeeper09 Aug 21 '13 at 21:55