Did you create a shell task?
I used to use a method similar to the one described in the bakery
article you link to. But a while back I switched to using a shell task
(less hacking more cake-friendly support).

A very simple shell might just look like this:

class HourlyShell extends Shell {
    function main() {
        $this->out("\n".'Hourly shell updates:');
        $this->log('Hourly shell updates @ '.date('Y-m-d H:i:s'),
'cron');

        // this is one of the few places I use requestAction.
        $this->requestAction('/controller/action', array
('return'=>true));
    }
}

In defence of requestAction :)
In my cron task I use requestAction for simplicity since performance
problems do not matter to the cron much... and I am calling plugins
and therefore want to have a unified way of calling each one. So I
call a method on "PluginnameController" for each plugin.

and the task should be called using the full paths (to avoid any
guesswork on the part of the shell):

/home/user/cake/cake/console/cake -app /home/user/cake/app hourly >>/
dev/null 2>&1

(That last bit of garbage code is needed so the cron runs ok on my
system. It halts if I pepper it with output)

/Martin



On Jan 20, 7:47 am, Kyle Decot <[email protected]> wrote:
> Thanks for the suggestion but I'm still getting the following error:
>
> Status: 404 Not Found
> X-Powered-By: PHP/5.2.8
> Content-type: text/html
>
> No input file specified.
>
> Any other ideas? Thank you for the help!
>
> On Jan 20, 1:25 am, _k10_ <[email protected]> wrote:
>
> > My guess is that your cron method is looking for a view and cannot
> > find it. Try adding 'exit' to the end of your method code. Also if you
> > are using cakephp 1.2 have a look 
> > athttp://book.cakephp.org/view/110/Creating-Shells-Tasks
>
> > _k10_http://www.innovatechnologies.in
>
> > On Jan 20, 3:38 am, Kyle Decot <[email protected]> wrote:
>
> > > I'm attempting to implement cron jobs into my website but I'm having a
> > > little trouble. I created the cron_dispatcher file I found 
> > > athttp://bakery.cakephp.org/articles/view/calling-controller-actions-fr...
>
> > > I then entered the following in my hostgator cron job page under the
> > > "command" field:
>
> > > php cron_dispatcher.php /pages/cron
>
> > > But when the job runs and I am notified via email, it says 404 not
> > > found. I am guessing that what I am putting in the command field is
> > > incorrect. Any Ideas on what would be the proper solution?
>
> > > Thank you as always.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to