AnsweredAssumed Answered

Scheduler not running

Question asked by Jagjit Singh on Aug 29, 2016
Latest reply on Sep 5, 2016 by Avinash Singh


   Scheduler is not running.

I have this Batch file

cd C:\xampp\htdocs\SugarCrm
c:\xampp\php\php-cgi.exe -c c:\xampp\php\php.ini -f cron.php 

I put alert in cron.php but is not showing


These are 2 other files created after Repair in these folders


//WARNING: The contents of this file are auto-generated

$mod_strings['LBL_MYLEADS'] = 'Leads Report';


C:\xampp\htdocs\SugarCrm\custom\modules\Schedulers\Ext\ScheduledTasks\scheduledtasks.ext.php . In this csv is also not getting created.



array_push($job_strings, 'MYLEAD');

function MYLEAD() {

$leadsArray = array();
$leadsBean = BeanFactory::getBean('Leads');
$leads = $leadsBean->get_full_list('', "date_entered > SUBDATE(NOW(),2)");
if ($leads != null) {
foreach ($leads as $lead) {
$leadsArray[] = array(

$fp = fopen('/tmp/leads.csv', 'w');

foreach ($leadsArray as $fields) {
fputcsv($fp, $fields);


$emailObj = new Email();
$defaults = $emailObj->getSystemDefaultEmail();
$mail = new SugarPHPMailer();
$mail->From = $defaults[''];
$mail->FromName = $defaults['Test'];
$mail->Subject = 'Leads';
$mail->Body = 'Please find attached all leads from yesterday';
$mail->addAttachment('/tmp/leads.csv', date("Y-m-d-H-i") . "-leads.csv", Encoding::Base64, "text/csv");
return true;