Using cake 2.1.1. I'm trying to make a cron job to execute an action from a controller. Which is right way to do this? I have the OffersController with an action called admin_test. I'd wish to run this action every 2 hours. For the moment I made a shell in app/Console/command/SyncapiShell.php:
class SyncapiShell extends AppShell {
public $uses = array('Offer');
public function main() {
$this->Offer->admin_test();
}
}
But I get a SQLSTATE[42000] Syntax error or access violation trying to execute the shell. I'm also using the admin routing, the auth component and ACL. How does the shell work? It ignores the authentication and the acl rights? Normally the admin_test action may be accessed only by specific authenticated users.
Thank you
