Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

ScheduledTask errors


Reply

2 Posts   440 Views

Avatar
Room9

12 July 2012 at 2:51pm Community Member, 19 Posts

I've run a ScheduledTask successfully through the browser, but when running via cli I get errors:

14:48:09 me@computer[webroot]$ ./sapphire/cli-script.php /ProcessOrdersDailyTask
./sapphire/cli-script.php: line 1: ?php: No such file or directory
./sapphire/cli-script.php: line 3: /Applications: is a directory
./sapphire/cli-script.php: line 4: assets: command not found
./sapphire/cli-script.php: line 5: assets: command not found
./sapphire/cli-script.php: line 6: assets: command not found
./sapphire/cli-script.php: line 7: assets: command not found
./sapphire/cli-script.php: line 8: assets: command not found
./sapphire/cli-script.php: line 9: assets: command not found
./sapphire/cli-script.php: line 10: assets/: is a directory
./sapphire/cli-script.php: line 12: /Applications: is a directory
./sapphire/cli-script.php: line 76: unexpected EOF while looking for matching `"'
./sapphire/cli-script.php: line 80: syntax error: unexpected end of file

Same thing using the full path to cli-script.php.

Any ideas what I'm missing?

Thanks

Avatar
Willr

12 July 2012 at 5:34pm Forum Moderator, 5511 Posts

CLI script is a PHP script so you will need to call it through 'php' first (php ./sapphire/cli-script.php). Or you can use sake, which is the CLI executable tool - http://doc.silverstripe.org/framework/en/topics/commandline