Re: Cron Job Hostgator

2009-02-11 Thread Kyle Decot

I've put what you suggested into my Cron Manager on my HostGator admin
panel but I am receiving an email that says:

TERM environment variable not set.
1

Any ideas? Thank you as always!


On Jan 21, 2:53 am, Martin Westin  wrote:
> You type (paste) something like this into a terminal window:
>
> /path/to/cake/console/cake -app /path/to/cake/app
>
> you then add the name of theshellyou want to run. My cron task is
> called "hourly" as in my previous post.
> When running this as a cron job (= automatically) I have found the
> return from theshellcauses problems so I add " >>/
> dev/null 2>&1 " at the end which swallows any output.
>
> On your Mac you might not want to run it as a cron. But if you do
> there are applications to download that give you a graphical tool to
> set cron jobs (or Apple's replacement as the case may be). The actual
> "cron" tools are aparently now seen av deprecated by Apple (sigh) but
> they are still there.
>
> /Martin
>
> On Jan 20, 2:57 pm,KyleDecot wrote:
>
> > I'm really confused aboutshelltasks. How would I invoke the task? I
> > know that I would use terminal (I'm on a mac) but how would I do this?
> > Second, how do you automate this process so that it would run every
> > hour?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cron Job Hostgator

2009-01-20 Thread Martin Westin


You type (paste) something like this into a terminal window:

/path/to/cake/console/cake -app /path/to/cake/app

you then add the name of the shell you want to run. My cron task is
called "hourly" as in my previous post.
When running this as a cron job (= automatically) I have found the
return from the shell causes problems so I add " >>/
dev/null 2>&1 " at the end which swallows any output.

On your Mac you might not want to run it as a cron. But if you do
there are applications to download that give you a graphical tool to
set cron jobs (or Apple's replacement as the case may be). The actual
"cron" tools are aparently now seen av deprecated by Apple (sigh) but
they are still there.

/Martin


On Jan 20, 2:57 pm, Kyle Decot  wrote:
> I'm really confused about shell tasks. How would I invoke the task? I
> know that I would use terminal (I'm on a mac) but how would I do this?
> Second, how do you automate this process so that it would run every
> hour?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cron Job Hostgator

2009-01-20 Thread Kyle Decot

I'm really confused about shell tasks. How would I invoke the task? I
know that I would use terminal (I'm on a mac) but how would I do this?
Second, how do you automate this process so that it would run every
hour?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cron Job Hostgator

2009-01-20 Thread Martin Westin


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  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_  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  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 cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cron Job Hostgator

2009-01-19 Thread Kyle Decot

I also forgot to mention that this website is set up as an addon
domain. I'm not sure if this would affect anything but thought it
would be worth mentioning.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cron Job Hostgator

2009-01-19 Thread Kyle Decot

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_  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  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 cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cron Job Hostgator

2009-01-19 Thread _k10_

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 at 
http://book.cakephp.org/view/110/Creating-Shells-Tasks

_k10_
http://www.innovatechnologies.in

On Jan 20, 3:38 am, Kyle Decot  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 cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Cron Job Hostgator

2009-01-19 Thread Kyle Decot

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 at
http://bakery.cakephp.org/articles/view/calling-controller-actions-from-cron-and-the-command-line

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---