Re: [web2py] Re: web2py scheduler not working
Why can't you add that line in cron? I don't get it. Scheduler WILL be running if you do it, you just need a full path to web2py.py. Did you even try? What wasn't working? Anyway there is another way to start scheduler in background: http://web2py.com/books/default/chapter/29/13/deployment-recipes#Start-the-scheduler-as-a-Linux-service-%28upstart%29 Marin On Wed, Oct 23, 2013 at 7:43 AM, ranjith ranjith2...@gmail.com wrote: Thanks for the response. Other than the below script, it was mentioned in the document that scheduler workers can be started via cron@reboot The scheduler does not use cron, although one can use cron @reboot to start the worker nodes. I am just starting to work on web2py. So, sorry for ignorance. As far as I know, @reboot can be used to call any python function in the application. If so, how do i start the worker nodes in that function. The below script python web2py.py -k myapp cant be added there. So is there a way to start the worker nodes in a python function?? so that on every reboot i can call that function via @reboot and the worker nodes will be started automatically. On Tuesday, 22 October 2013 23:57:27 UTC+5:30, Marin Pranjić wrote: You are not supposed to add entries to scheduler_worker. You need to run scheduler in the background. python web2py.py -K myapp Detailed explanation here: http://web2py.com/books/default/chapter/29/04/the-core#Scheduler Marin On Tue, Oct 22, 2013 at 8:25 PM, ranjith ranji...@gmail.com wrote: I tried changing the worker table status to active/pick and others. It didnt work On Tuesday, 22 October 2013 23:53:24 UTC+5:30, ranjith wrote: Hi, I have a model file called scheduler.py which has from gluon.scheduler import Scheduler def messageTask(): mail.send(to=['ranji...@gmail.com'],subject='hello', message='hi there') return scheduler = Scheduler(db,tasks=dict(messageTask=messageTask)) I added an entry in scheduler_task table Application Name: Task Name: Group Name: Status: Function Name: Uuid: Args: Vars: Enabled: Start Time: Next Run Time: Stop Time: Repeats:0=unlimited Retry Failed:-1=unlimited Period:seconds Timeout:seconds Sync Output:update output every n sec: 0=never Times Run: Times Failed: Last Run Time: Assigned Worker Name: I have also added an entry in scheulder_worker table Id:1 Worker Name: First Heartbeat: Last Heartbeat: Status: Is Ticker: Group Names: + - Check to delete: But the the function is not getting scheduled. Am I missing something here? Please help scheduler_run.task_id -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: web2py scheduler not working
@ranjith, I think that you may be confusing the difference between Unix/Linux cron https://en.wikipedia.org/wiki/Cron and the cronhttp://web2py.com/books/default/chapter/29/04/the-core?search=cron#Cron provided by web2py which are two different things. What @Marin is meaning is that you'd have the operating system's cron (or upstart or windows scheduler, nssm, whatever) kick off the scheduler process for you when the OS starts. I don't think that it is possible to have web2py's cron kick off the web2py scheduler. On Wednesday, October 23, 2013 12:43:53 AM UTC-5, ranjith wrote: Thanks for the response. Other than the below script, it was mentioned in the document that scheduler workers can be started via cron@reboot The scheduler does not use cron, although one can use cron @reboot to start the worker nodes. I am just starting to work on web2py. So, sorry for ignorance. As far as I know, @reboot can be used to call any python function in the application. If so, how do i start the worker nodes in that function. The below script python web2py.py -k myapp cant be added there. So is there a way to start the worker nodes in a python function?? so that on every reboot i can call that function via @reboot and the worker nodes will be started automatically. On Tuesday, 22 October 2013 23:57:27 UTC+5:30, Marin Pranjić wrote: You are not supposed to add entries to scheduler_worker. You need to run scheduler in the background. python web2py.py -K myapp Detailed explanation here: http://web2py.com/books/default/chapter/29/04/the-core#Scheduler Marin On Tue, Oct 22, 2013 at 8:25 PM, ranjith ranji...@gmail.com wrote: I tried changing the worker table status to active/pick and others. It didnt work On Tuesday, 22 October 2013 23:53:24 UTC+5:30, ranjith wrote: Hi, I have a model file called scheduler.py which has from gluon.scheduler import Scheduler def messageTask(): mail.send(to=['ranji...@gmail.com'],subject='hello', message='hi there') return scheduler = Scheduler(db,tasks=dict(messageTask=messageTask)) I added an entry in scheduler_task table Application Name: Task Name: Group Name: Status: Function Name: Uuid: Args: Vars: Enabled: Start Time: Next Run Time: Stop Time: Repeats:0=unlimited Retry Failed:-1=unlimited Period:seconds Timeout:seconds Sync Output:update output every n sec: 0=never Times Run: Times Failed: Last Run Time: Assigned Worker Name: I have also added an entry in scheulder_worker table Id:1 Worker Name: First Heartbeat: Last Heartbeat: Status: Is Ticker: Group Names: + - Check to delete: But the the function is not getting scheduled. Am I missing something here? Please help scheduler_run.task_id -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: web2py scheduler not working
Is that not possible? On Wednesday, 23 October 2013 11:13:53 UTC+5:30, ranjith wrote: Thanks for the response. Other than the below script, it was mentioned in the document that scheduler workers can be started via cron@reboot The scheduler does not use cron, although one can use cron @reboot to start the worker nodes. I am just starting to work on web2py. So, sorry for ignorance. As far as I know, @reboot can be used to call any python function in the application. If so, how do i start the worker nodes in that function. The below script python web2py.py -k myapp cant be added there. So is there a way to start the worker nodes in a python function?? so that on every reboot i can call that function via @reboot and the worker nodes will be started automatically. On Tuesday, 22 October 2013 23:57:27 UTC+5:30, Marin Pranjić wrote: You are not supposed to add entries to scheduler_worker. You need to run scheduler in the background. python web2py.py -K myapp Detailed explanation here: http://web2py.com/books/default/chapter/29/04/the-core#Scheduler Marin On Tue, Oct 22, 2013 at 8:25 PM, ranjith ranji...@gmail.com wrote: I tried changing the worker table status to active/pick and others. It didnt work On Tuesday, 22 October 2013 23:53:24 UTC+5:30, ranjith wrote: Hi, I have a model file called scheduler.py which has from gluon.scheduler import Scheduler def messageTask(): mail.send(to=['ranji...@gmail.com'],subject='hello', message='hi there') return scheduler = Scheduler(db,tasks=dict(messageTask=messageTask)) I added an entry in scheduler_task table Application Name: Task Name: Group Name: Status: Function Name: Uuid: Args: Vars: Enabled: Start Time: Next Run Time: Stop Time: Repeats:0=unlimited Retry Failed:-1=unlimited Period:seconds Timeout:seconds Sync Output:update output every n sec: 0=never Times Run: Times Failed: Last Run Time: Assigned Worker Name: I have also added an entry in scheulder_worker table Id:1 Worker Name: First Heartbeat: Last Heartbeat: Status: Is Ticker: Group Names: + - Check to delete: But the the function is not getting scheduled. Am I missing something here? Please help scheduler_run.task_id -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: web2py scheduler not working
You are not supposed to add entries to scheduler_worker. You need to run scheduler in the background. python web2py.py -K myapp Detailed explanation here: http://web2py.com/books/default/chapter/29/04/the-core#Scheduler Marin On Tue, Oct 22, 2013 at 8:25 PM, ranjith ranjith2...@gmail.com wrote: I tried changing the worker table status to active/pick and others. It didnt work On Tuesday, 22 October 2013 23:53:24 UTC+5:30, ranjith wrote: Hi, I have a model file called scheduler.py which has from gluon.scheduler import Scheduler def messageTask(): mail.send(to=['ranjith2...@gmail.com'],subject='hello', message='hi there') return scheduler = Scheduler(db,tasks=dict(messageTask=messageTask)) I added an entry in scheduler_task table Application Name: Task Name: Group Name: Status: Function Name: Uuid: Args: Vars: Enabled: Start Time: Next Run Time: Stop Time: Repeats:0=unlimited Retry Failed:-1=unlimited Period:seconds Timeout:seconds Sync Output:update output every n sec: 0=never Times Run: Times Failed: Last Run Time: Assigned Worker Name: I have also added an entry in scheulder_worker table Id:1 Worker Name: First Heartbeat: Last Heartbeat: Status: Is Ticker: Group Names: + - Check to delete: But the the function is not getting scheduled. Am I missing something here? Please help scheduler_run.task_id -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: web2py scheduler not working
Thanks for the response. Other than the below script, it was mentioned in the document that scheduler workers can be started via cron@reboot The scheduler does not use cron, although one can use cron @reboot to start the worker nodes. I am just starting to work on web2py. So, sorry for ignorance. As far as I know, @reboot can be used to call any python function in the application. If so, how do i start the worker nodes in that function. The below script python web2py.py -k myapp cant be added there. So is there a way to start the worker nodes in a python function?? so that on every reboot i can call that function via @reboot and the worker nodes will be started automatically. On Tuesday, 22 October 2013 23:57:27 UTC+5:30, Marin Pranjić wrote: You are not supposed to add entries to scheduler_worker. You need to run scheduler in the background. python web2py.py -K myapp Detailed explanation here: http://web2py.com/books/default/chapter/29/04/the-core#Scheduler Marin On Tue, Oct 22, 2013 at 8:25 PM, ranjith ranji...@gmail.com javascript: wrote: I tried changing the worker table status to active/pick and others. It didnt work On Tuesday, 22 October 2013 23:53:24 UTC+5:30, ranjith wrote: Hi, I have a model file called scheduler.py which has from gluon.scheduler import Scheduler def messageTask(): mail.send(to=['ranji...@gmail.com javascript:'],subject='hello', message='hi there') return scheduler = Scheduler(db,tasks=dict(messageTask=messageTask)) I added an entry in scheduler_task table Application Name: Task Name: Group Name: Status: Function Name: Uuid: Args: Vars: Enabled: Start Time: Next Run Time: Stop Time: Repeats:0=unlimited Retry Failed:-1=unlimited Period:seconds Timeout:seconds Sync Output:update output every n sec: 0=never Times Run: Times Failed: Last Run Time: Assigned Worker Name: I have also added an entry in scheulder_worker table Id:1 Worker Name: First Heartbeat: Last Heartbeat: Status: Is Ticker: Group Names: + - Check to delete: But the the function is not getting scheduled. Am I missing something here? Please help scheduler_run.task_id -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.