SilverStripe Triggers BuildTasks Error Via CronJob

I am working on running tasks via CronJob in SilverStripe 3.1.

I tested with command line, everything works fine.

But through a Cron job, it always gives the following message:

Please provide an argument for cli- script.php / sake. For more information visit http://doc.silverstripe.org/framework/en/topics/commandline ** "

I read the docs but I still don't know.

My cron job command:

/my_site_path/framework/sake dev/tasks/SendNewsLetter >> /my_site_path/newsletter.log 2>&1

      

I created a task SendNewsLetter

that extended from BuildTask

.

I tried it in browser and command line, everything seems to be no problem. However, I was unable to get it to work with the cron job.

+3


source to share


1 answer


Try this instead

php-cli -q / my_site_path / framework / cli- script.php dev / tasks / SendNewsLetter -> /my_site_path/newsletter.log 2> & 1



the tasks performed this way work for me.

+2


source







All Articles