I'm working on running tasks via CronJob in SilverStripe 3.1.
I tested with command line, everything works fine.
But via Cron job, it always gives the following message:
Please specify an argument to cli-script.php/sake. For more information, visit http://doc.silverstripe.org/framework/en/topics/commandline**"
I have read the docs but I still have no idea.
My cron job command:
/my_site_path/framework/sake dev/tasks/SendNewsLetter >> /my_site_path/newsletter.log 2>&1
I created a SendNewsLetter task which is extended from BuildTask.
I tried it in the browser and command line, it all seems to work with no problem. However, I haven't been able to get it working with cron job.
Try executing it this way instead:
php-cli -q /my_site_path/framework/cli-script.php dev/tasks/SendNewsLetter >> /my_site_path/newsletter.log 2>&1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With