Re: Run a cron job in cakephp

2011-11-04 Thread Eric Blanpied
My workers are just PHP. I've got one doing curl stuff to transfer big
files, and another to drive ffmpeg for slow encodes. You can write
your Gearman clients in pretty much anything, though. They've got a
bunch of client libraries. The PHP one is pretty comprehensive, and
I've experimented with python workers, too. You can also post status
updates back from the worker if you want to do an ajax progress bar or
something.

There's a fair amount of stuff out there about gearman, but I found
this especially useful: http://tinyurl.com/y8vyc8f

I suppose we've left cake territory here, tho...

-e

On Fri, Nov 4, 2011 at 11:29 AM, Werner Petry Moraes  wrote:
> Hi,
> that cake method you call from within the worker, is it written as a shell?
> Or how do you do it?
> I'm not familiar with gearman, but I think I'm gonna need it soon.
> thanks
> atenciosamente,
> Werner Petry Moraes
> werne...@gmail.com
>
>
> On Fri, Nov 4, 2011 at 06:16, Eric Blanpied  wrote:
>>
>> I think the best way to do it is with a queue. After doing several
>> websites in which cron jobs were used for various not-so-cron things
>> (cron job to wake up periodically and check for needed tasks? why not
>> just spawn the tasks?), I came to the conclusion that a job queue was
>> a much smarter answer.
>>
>> Accordingly, I've just woven Gearman (http://gearman.org/) into one of
>> our cake projects, with a very simple component wrapping the gearman
>> client. The workers are pure php, with no knowledge of the app or
>> database, reducing dependencies as well as possible. The client passes
>> the workers json-encoded parameters, and the workers call a cake
>> method when done, again with json-encoded return data, and cake makes
>> any database updates as appropriate. Now we can do all sorts of things
>> outside of the user's browser session, and in the future could move
>> these things off to a different server if we wished.
>>
>> Of course, if your other tasks were very much cake-related, and you
>> wanted them to use the framework, I see no reason why you couldn't
>> write your workers within the framework.
>>
>> There are other queue/messaging systems out there (beanstalk's got a
>> good following), but in my research I liked what gearman had to offer
>> best. There's also Persson's cakephp Queue plugin, but I wanted a
>> lighter system, with no cake dependencies on the worker side.
>>
>> -e
>>
>> On Fri, Nov 4, 2011 at 8:12 AM, flo.kl...@googlemail.com
>>  wrote:
>> > What about using javascript. It would only work while the user is on the
>> > site, but it would be able to call a function (also ajax if you want to
>> > trigger a php method) very x seconds.
>> >
>> > -flosky
>> >
>> >
>> >
>> > Ryan Schmidt  schrieb:
>> >>
>> >> On Nov 4, 2011, at 00:17, zuha wrote:
>> >>
>> >> > is there anyway to run a process separate from the page load.  I
>> >> > would
>> >> > love to run a pseudo cronjob on each page load if it could be done
>> >> > without
>> >> > negatively effecting performance in a serious way.  (I was thinking
>> >> > curl,
>> >> > and ajax, but they didn't really seem to fit the bill)   Any experts
>> >> > out
>> >> > there know how to start a cron task outside of the page load, but
>> >> > triggered
>> >> > by a page load?
>> >>
>> >> cron is a program that schedules things to run at particular times of
>> >> the
>> >> day. "start a cron task ... triggered by a page load" therefore doesn't
>> >> make
>> >> sense.
>> >>
>> >> What kind of task do you want to start? The solution might be different
>> >> depending on the task.
>> >>
>> >>
>> >> --
>> >> Our newest site for the community: CakePHP Video Tutorials
>> >> http://tv.cakephp.org
>> >> Check out the new CakePHP Questions site http://ask.cakephp.org and
>> >> help
>> >> others with their CakePHP related questions.
>> >>
>> >>
>> >> 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
>> >
>> > --
>> > Our newest site for the community: CakePHP Video Tutorials
>> > http://tv.cakephp.org
>> > Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> > others with their CakePHP related questions.
>> >
>> >
>> > 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
>> >
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> 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
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and

Re: Run a cron job in cakephp

2011-11-04 Thread zuha
Cron is not only for particular times, its also for recurring events.  It 
certainly does make sense if you simply set your task to check what time it 
is before executing.  Then you just "try" to run it every minute (or every 
page load), and it will fire only at the appropriate time.   This makes a 
lot of sense for something like triggered notifications which don't happen 
until X days after X event, and aren't at any particular time, but instead 
are relative time. 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Run a cron job in cakephp

2011-11-04 Thread zuha
Oh that looks promising, if anything it should at least get us started.   
Thank you for that :  https://github.com/MSeven/cakephp_queue/wiki

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Run a cron job in cakephp

2011-11-04 Thread Werner Petry Moraes
Hi,

that cake method you call from within the worker, is it written as a shell?
Or how do you do it?
I'm not familiar with gearman, but I think I'm gonna need it soon.

thanks

atenciosamente,
Werner Petry Moraes
werne...@gmail.com


On Fri, Nov 4, 2011 at 06:16, Eric Blanpied  wrote:

> I think the best way to do it is with a queue. After doing several
> websites in which cron jobs were used for various not-so-cron things
> (cron job to wake up periodically and check for needed tasks? why not
> just spawn the tasks?), I came to the conclusion that a job queue was
> a much smarter answer.
>
> Accordingly, I've just woven Gearman (http://gearman.org/) into one of
> our cake projects, with a very simple component wrapping the gearman
> client. The workers are pure php, with no knowledge of the app or
> database, reducing dependencies as well as possible. The client passes
> the workers json-encoded parameters, and the workers call a cake
> method when done, again with json-encoded return data, and cake makes
> any database updates as appropriate. Now we can do all sorts of things
> outside of the user's browser session, and in the future could move
> these things off to a different server if we wished.
>
> Of course, if your other tasks were very much cake-related, and you
> wanted them to use the framework, I see no reason why you couldn't
> write your workers within the framework.
>
> There are other queue/messaging systems out there (beanstalk's got a
> good following), but in my research I liked what gearman had to offer
> best. There's also Persson's cakephp Queue plugin, but I wanted a
> lighter system, with no cake dependencies on the worker side.
>
> -e
>
> On Fri, Nov 4, 2011 at 8:12 AM, flo.kl...@googlemail.com
>  wrote:
> > What about using javascript. It would only work while the user is on the
> > site, but it would be able to call a function (also ajax if you want to
> > trigger a php method) very x seconds.
> >
> > -flosky
> >
> >
> >
> > Ryan Schmidt  schrieb:
> >>
> >> On Nov 4, 2011, at 00:17, zuha wrote:
> >>
> >> > is there anyway to run a process separate from the page load.  I would
> >> > love to run a pseudo cronjob on each page load if it could be done
> without
> >> > negatively effecting performance in a serious way.  (I was thinking
> curl,
> >> > and ajax, but they didn't really seem to fit the bill)   Any experts
> out
> >> > there know how to start a cron task outside of the page load, but
> triggered
> >> > by a page load?
> >>
> >> cron is a program that schedules things to run at particular times of
> the
> >> day. "start a cron task ... triggered by a page load" therefore doesn't
> make
> >> sense.
> >>
> >> What kind of task do you want to start? The solution might be different
> >> depending on the task.
> >>
> >>
> >> --
> >> Our newest site for the community: CakePHP Video Tutorials
> >> http://tv.cakephp.org
> >> Check out the new CakePHP Questions site http://ask.cakephp.org and
> help
> >> others with their CakePHP related questions.
> >>
> >>
> >> 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
> >
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> > http://tv.cakephp.org
> > Check out the new CakePHP Questions site http://ask.cakephp.org and help
> > others with their CakePHP related questions.
> >
> >
> > 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
> >
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> 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
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Run a cron job in cakephp

2011-11-04 Thread Eric Blanpied
I think the best way to do it is with a queue. After doing several
websites in which cron jobs were used for various not-so-cron things
(cron job to wake up periodically and check for needed tasks? why not
just spawn the tasks?), I came to the conclusion that a job queue was
a much smarter answer.

Accordingly, I've just woven Gearman (http://gearman.org/) into one of
our cake projects, with a very simple component wrapping the gearman
client. The workers are pure php, with no knowledge of the app or
database, reducing dependencies as well as possible. The client passes
the workers json-encoded parameters, and the workers call a cake
method when done, again with json-encoded return data, and cake makes
any database updates as appropriate. Now we can do all sorts of things
outside of the user's browser session, and in the future could move
these things off to a different server if we wished.

Of course, if your other tasks were very much cake-related, and you
wanted them to use the framework, I see no reason why you couldn't
write your workers within the framework.

There are other queue/messaging systems out there (beanstalk's got a
good following), but in my research I liked what gearman had to offer
best. There's also Persson's cakephp Queue plugin, but I wanted a
lighter system, with no cake dependencies on the worker side.

-e

On Fri, Nov 4, 2011 at 8:12 AM, flo.kl...@googlemail.com
 wrote:
> What about using javascript. It would only work while the user is on the
> site, but it would be able to call a function (also ajax if you want to
> trigger a php method) very x seconds.
>
> -flosky
>
>
>
> Ryan Schmidt  schrieb:
>>
>> On Nov 4, 2011, at 00:17, zuha wrote:
>>
>> > is there anyway to run a process separate from the page load.  I would
>> > love to run a pseudo cronjob on each page load if it could be done without
>> > negatively effecting performance in a serious way.  (I was thinking curl,
>> > and ajax, but they didn't really seem to fit the bill)   Any experts out
>> > there know how to start a cron task outside of the page load, but triggered
>> > by a page load?
>>
>> cron is a program that schedules things to run at particular times of the
>> day. "start a cron task ... triggered by a page load" therefore doesn't make
>> sense.
>>
>> What kind of task do you want to start? The solution might be different
>> depending on the task.
>>
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> 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
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> 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
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Run a cron job in cakephp

2011-11-04 Thread flo.kl...@googlemail.com
What about using javascript. It would only work while the user is on the site, 
but it would be able to call a function (also ajax if you want to trigger a php 
method) very x seconds.

-flosky



Ryan Schmidt  schrieb:


On Nov 4, 2011, at 00:17, zuha wrote:

> is there anyway to run a process separate from the page load. I would love to 
> run a pseudo cronjob on each page load if it could be done without negatively 
> effecting performance in a serious way. (I was thinking curl, and ajax, but 
> they didn't really seem to fit the bill) Any experts out there know how to 
> start a cron task outside of the page load, but triggered by a page load?

cron is a program that schedules things to run at particular times of the day. 
"start a cron task ... triggered by a page load" therefore doesn't make sense.

What kind of task do you want to start? The solution might be different 
depending on the task.


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Run a cron job in cakephp

2011-11-03 Thread Ryan Schmidt

On Nov 4, 2011, at 00:17, zuha wrote:

> is there anyway to run a process separate from the page load.  I would love 
> to run a pseudo cronjob on each page load if it could be done without 
> negatively effecting performance in a serious way.  (I was thinking curl, and 
> ajax, but they didn't really seem to fit the bill)   Any experts out there 
> know how to start a cron task outside of the page load, but triggered by a 
> page load?

cron is a program that schedules things to run at particular times of the day. 
"start a cron task ... triggered by a page load" therefore doesn't make sense.

What kind of task do you want to start? The solution might be different 
depending on the task.


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Run a cron job in cakephp

2011-11-03 Thread Greg Skerman
I was reading recently about a deferred execution pluginwhich kind of
did that I thought (i've not actually used it..)

https://github.com/MSeven/cakephp_queue/wiki

Queues a job, which gets picked up periodically by a worker and doesn't
hold up the page load.

Might be worth a look.


On Fri, Nov 4, 2011 at 3:17 PM, zuha  wrote:

> While we're on the topic though... is there anyway to run a process
> separate from the page load.  I would love to run a pseudo cronjob on each
> page load if it could be done without negatively effecting performance in a
> serious way.  (I was thinking curl, and ajax, but they didn't really seem
> to fit the bill)   Any experts out there know how to start a cron task
> outside of the page load, but triggered by a page load?
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> 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
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Run a cron job in cakephp

2011-11-03 Thread zuha
While we're on the topic though... is there anyway to run a process 
separate from the page load.  I would love to run a pseudo cronjob on each 
page load if it could be done without negatively effecting performance in a 
serious way.  (I was thinking curl, and ajax, but they didn't really seem 
to fit the bill)   Any experts out there know how to start a cron task 
outside of the page load, but triggered by a page load?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Run a cron job in cakephp

2011-11-03 Thread Ryan Schmidt

On Nov 3, 2011, at 23:29, abhimanyu bv wrote:

> @euromark,
> can you help me using crontab you posted in that link.

This isn't a CakePHP question. You should be able to find many tutorials online 
about how to use cron.



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Run a cron job in cakephp

2011-11-03 Thread abhimanyu bv
@euromark,
can you help me using crontab you posted in that link.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Run a cron job in cakephp

2011-11-03 Thread euromark
you can use crontab to do that
http://book.cakephp.org/view/1110/Running-Shells-as-cronjobs

and here is explained how you can set the time accordingly:
http://neeocis.wordpress.com/2008/07/08/crontab-every-five-minutes/



On 4 Nov., 03:21, Thiago Belem  wrote:
> Running a cronjob is something you do on your operating system, give a
> look:http://en.wikipedia.org/wiki/Cron
>
> Use this to call your shell task and you're done. :)
> --
> ***Thiago Belem*
> Desenvolvedor
> Rio de Janeiro - RJ - Brasil
>
> +55 (21) 8865.9250
> thiagobelem.net
> cont...@thiagobelem.net
>
> *Skype / gTalk **»* thiago.belem.web
> *LinkedIn* *»* br.linkedin.com/in/thiagobelem/pt*
> Assando Sites*, curso de CakePHP *»* assando-sites.com.br
>
> 2011/11/4 abhimanyu bv 
>
>
>
>
>
>
>
> > I would like to write a cron job that has to run a PHP script at 6am,
> > 11am,2pm,4pm on each day.
>
> > Can you please help me with this? I wrote a shell task in shells and I
> > want to run that task at the timings i said in the earlier statement.
>
> > Thanks.
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Run a cron job in cakephp

2011-11-03 Thread Thiago Belem
Running a cronjob is something you do on your operating system, give a
look: http://en.wikipedia.org/wiki/Cron

Use this to call your shell task and you're done. :)
--
***Thiago Belem*
Desenvolvedor
Rio de Janeiro - RJ - Brasil

+55 (21) 8865.9250
thiagobelem.net
cont...@thiagobelem.net

*Skype / gTalk **»* thiago.belem.web
*LinkedIn* *»* br.linkedin.com/in/thiagobelem/pt*
Assando Sites*, curso de CakePHP *»* assando-sites.com.br


2011/11/4 abhimanyu bv 

> I would like to write a cron job that has to run a PHP script at 6am,
> 11am,2pm,4pm on each day.
>
> Can you please help me with this? I wrote a shell task in shells and I
> want to run that task at the timings i said in the earlier statement.
>
> Thanks.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> 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
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


RE: Run a cron Job

2009-09-28 Thread Dave Maharaj :: WidePixels.com

Yeah the CP has basic and advanced. Basic you select days/month/min/time and
so on and enter /path/to/cake/console/cake -app /path/to/your/app
shell_task_name 
Advanced is the *** input 

Will give it another shot.

But based on the set up above if I have my shell code (reports.php) in
app/vendors/shell I would use something like /mypath/to/cake/console/cake
-app /mypath/app reports (mypath being changed obviously)

Dave

-Original Message-
From: brian [mailto:bally.z...@gmail.com] 
Sent: September-28-09 2:15 PM
To: cake-php@googlegroups.com
Subject: Re: Run a cron Job


On Mon, Sep 28, 2009 at 12:24 PM, Dave Maharaj :: WidePixels.com
 wrote:
>
> Yeah I set up a reports.php like they did in the Cookbook but even 
> when I try to run it from the control panel I keep getting '/bin/sh: 
> 15: command not found'

It looks like you're trying to feed the shell the example I posted.
The "15" being the first part, which the shell doesn't understand. The
"15 0 * * *" part of the line is what tells cron when to run the job.

How does your control panel set up cron jobs? Does it have a widget for
setting the time of day? If so, you probably want to do that and then
provide just this part as the job:

/path/to/cake/console/cake -app /path/to/your/app shell_task_name

Those paths are from root.



--~--~-~--~~~---~--~~
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: Run a cron Job

2009-09-28 Thread brian

On Mon, Sep 28, 2009 at 12:24 PM, Dave Maharaj :: WidePixels.com
 wrote:
>
> Yeah I set up a reports.php like they did in the Cookbook but even when I
> try to run it from the control panel I keep getting '/bin/sh: 15: command
> not found'

It looks like you're trying to feed the shell the example I posted.
The "15" being the first part, which the shell doesn't understand. The
"15 0 * * *" part of the line is what tells cron when to run the job.

How does your control panel set up cron jobs? Does it have a widget
for setting the time of day? If so, you probably want to do that and
then provide just this part as the job:

/path/to/cake/console/cake -app /path/to/your/app shell_task_name

Those paths are from root.

--~--~-~--~~~---~--~~
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: Run a cron Job

2009-09-28 Thread Dave Maharaj :: WidePixels.com

Yeah I set up a reports.php like they did in the Cookbook but even when I
try to run it from the control panel I keep getting '/bin/sh: 15: command
not found'

I will just leave it for now and run it myself from admin.

Dave


-Original Message-
From: Miles J [mailto:mileswjohn...@gmail.com] 
Sent: September-28-09 1:49 PM
To: CakePHP
Subject: Re: Run a cron Job


Cron isn't run through PHP, I think thats what your trying to get at.
You have to setup cron jobs through your hosts control panel, or at least
figure out where you define your cron jobs.

On Sep 28, 8:58 am, brian  wrote:
> On Mon, Sep 28, 2009 at 10:02 AM, Dave Maharaj :: WidePixels.com
>
>  wrote:
>
> > Ok, thanks,
>
> > I want the cron to run by its self at a specific time. SoI do not 
> > have to do it myself daily. Can this be done in your approach? New to
cron set up.
>
> Yes, this is exactly what cron is for. You'd enter it like so:
>
> 15 0 * * * /path/to/cake/console/cake -app /path/to/your/app 
> shell_task_name
>
> Have a look online how to set up jobs at a particular time.


--~--~-~--~~~---~--~~
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: Run a cron Job

2009-09-28 Thread Miles J

Cron isn't run through PHP, I think thats what your trying to get at.
You have to setup cron jobs through your hosts control panel, or at
least figure out where you define your cron jobs.

On Sep 28, 8:58 am, brian  wrote:
> On Mon, Sep 28, 2009 at 10:02 AM, Dave Maharaj :: WidePixels.com
>
>  wrote:
>
> > Ok, thanks,
>
> > I want the cron to run by its self at a specific time. SoI do not have to do
> > it myself daily. Can this be done in your approach? New to cron set up.
>
> Yes, this is exactly what cron is for. You'd enter it like so:
>
> 15 0 * * * /path/to/cake/console/cake -app /path/to/your/app shell_task_name
>
> Have a look online how to set up jobs at a particular time.
--~--~-~--~~~---~--~~
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: Run a cron Job

2009-09-28 Thread brian

On Mon, Sep 28, 2009 at 10:02 AM, Dave Maharaj :: WidePixels.com
 wrote:
>
> Ok, thanks,
>
> I want the cron to run by its self at a specific time. SoI do not have to do
> it myself daily. Can this be done in your approach? New to cron set up.
>

Yes, this is exactly what cron is for. You'd enter it like so:

15 0 * * * /path/to/cake/console/cake -app /path/to/your/app shell_task_name

Have a look online how to set up jobs at a particular time.

--~--~-~--~~~---~--~~
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: Run a cron Job

2009-09-28 Thread Dave Maharaj :: WidePixels.com

Ok, thanks,

I want the cron to run by its self at a specific time. SoI do not have to do
it myself daily. Can this be done in your approach? New to cron set up.

Will check into the shell approach.

Dave 

-Original Message-
From: Martin Westin [mailto:martin.westin...@gmail.com] 
Sent: September-28-09 9:33 AM
To: CakePHP
Subject: Re: Run a cron Job


The cake shell is prefect for this.
I do cron tasks by creating Cake shell tasks and from there I do a
requestAction if I really need to call an action.

This is what I tell cron:
/ful/path/to/cake/console/cake -app /full/path/to/app shellname >>/dev/ null
2>&1

The last bit (dev/null and that) makes the shell totally silent which is
needed unless you want the cron to terminate unexpectedly. But when testing
yourself you should leave that out so you can see the output.



On Sep 27, 6:27 pm, "Dave Maharaj :: WidePixels.com"
 wrote:
> Trying to set up an action to run at a specific time. Found a few 
> sites saying replace require CORE_PATH.'cake'.DS.'bootstrap.php';
> in index.php but no longer appears to be there.
>
> Any good places to look where to set this up?
>
> Thanks
>
> Dave


--~--~-~--~~~---~--~~
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: Run a cron Job

2009-09-28 Thread Martin Westin

The cake shell is prefect for this.
I do cron tasks by creating Cake shell tasks and from there I do a
requestAction if I really need to call an action.

This is what I tell cron:
/ful/path/to/cake/console/cake -app /full/path/to/app shellname >>/dev/
null 2>&1

The last bit (dev/null and that) makes the shell totally silent which
is needed unless you want the cron to terminate unexpectedly. But when
testing yourself you should leave that out so you can see the output.



On Sep 27, 6:27 pm, "Dave Maharaj :: WidePixels.com"
 wrote:
> Trying to set up an action to run at a specific time. Found a few sites
> saying replace
> require CORE_PATH.'cake'.DS.'bootstrap.php';
> in index.php but no longer appears to be there.
>
> Any good places to look where to set this up?
>
> Thanks
>
> Dave
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---