I am trying to get a cronjob in CakePHP work. But I am getting this error: Error: Class TestingShell could not be loaded.
Here is my /app/vendors/shells/testing.php
file:
class TestingShell extends 开发者_JS百科Shell {
var $uses = array('Test');
function main(){
$this->out('Number of tests :');
$this->out($this->Test->find('count'));
$this->out('.');
if($this->Test->delete(1)){
$this->out('test deleted');
}
else{
$this->out('test not deleted');
}
}
}
I am calling the cronjob like this: /home/root/public_html/site/cake/console/cake -app /home/root/public_html/site/app testing
What am I doing wrong? Thank you very much!
EDIT I must add that, locally, the shell works fine.
Check out this bug report -- this was my problem.
http://cakephp.lighthouseapp.com/projects/42648/tickets/1601-cakephp-138-console-ignores-app-parameter
Rolling back to 1.3.7 was the quick fix.
have a look at this, you may also need the added shell script
http://book.cakephp.org/view/1110/Running-Shells-as-cronjobs
you also have the params wrong way round, its
1 * * * * cake/path scritp params -app app/path
精彩评论