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

Getting DailyTask to work


Reply

2 Posts   1425 Views

Avatar
Andrew Houle

30 July 2010 at 5:02am Community Member, 132 Posts

I have a simple function set up for a Daily Scheduled Task. It was difficult to find info on this topic, but I pieced together enough to get me real close. I know the task works because it tests ok when I run http://yourdomain.com/DailyTask

I've setup a cron job that looks like this: */1 * * * * /usr/bin/php-cgi /path/to/my/site/sapphire/cli-script.php DailyTask I set it up for every minute just for testing purposes. The email log that I receive stats this, "Please specify an argument to cli-script.php/sake. For more information, visit http://doc.silverstripe.org/doku.php?id=sake" I tried setting up the _ss_environment.php file according to the info there and here - http://www.silverstripe.org/general-questions/show/260805#post260805 but to no success. My _ss_environment.php looks like this

<?php
global $_FILE_TO_URL_MAPPING;
$_FILE_TO_URL_MAPPING['/path/to/my/site'] = 'http://mydomain.com';
?>

I'm running low on ideas, any help would be very much appreciated.

Thanks,
Andrew

Avatar
Andrew Houle

30 July 2010 at 6:07am Community Member, 132 Posts

For completion sake, I got this to run thanks to some folks in the IRC with the following...

*/1 * * * * cd /path/to/my/site usr/bin/php-cgi && php sapphire/cli-script.php DailyTask

I'm on php 5.1.x so that's why I think it was failing.