Re: [web2py] Re: cron setup

2012-03-01 Thread Luciano Pacheco
Sorry, now I have no idea about the error, since I'm still very new to
web2py. :-)

Anyone know about this error?


On Thu, Mar 1, 2012 at 2:16 PM, Sanjeet Kumar sanjeet@gmail.com wrote:

 Luciano i removed the one * before the applications and tryed than i got
 the following error :-


 OperationalError: unable to open database file
 Traceback (most recent call last):
   File /home/tls-sanjeet/Desktop/test/web2py/gluon/restricted.py, line
 204, in restricted
 exec ccode in environment
   File applications/welcome/models/db.py, line 14, in module
 db = DAL('sqlite://storage.sqlite')
   File /home/tls-sanjeet/Desktop/test/web2py/gluon/dal.py, line 4749, in
 __init__
 raise RuntimeError, Failure to connect, tried %d times:\n%s %
 (attempts, tb)
 RuntimeError: Failure to connect, tried 5 times:
 Traceback (most recent call last):
   File /home/tls-sanjeet/Desktop/test/web2py/gluon/dal.py, line 4736, in
 __init__
 self._adapter = ADAPTERS[self._dbname](*args)
   File /home/tls-sanjeet/Desktop/test/web2py/gluon/dal.py, line 1655, in
 __init__
 self.pool_connection(connect)
   File /home/tls-sanjeet/Desktop/test/web2py/gluon/dal.py, line 444, in
 pool_connection
 self.connection = f()
   File /home/tls-sanjeet/Desktop/test/web2py/gluon/dal.py, line 1654, in
 connect
 return self.driver.Connection(dbpath, **driver_args)
 OperationalError: unable to open database file



 On Wednesday, February 29, 2012 6:39:22 PM UTC+5:30, lucmult wrote:



 On Wed, Feb 29, 2012 at 11:10 PM, Sanjeet Kumar sanjeet@gmail.comwrote:

 I have the following code in my crontab :-

 0-59/1****root **applications/welcome/cron/**test.py


 put just 1 * before applications/

 [],
 --
 Luciano Pacheco
 blog.lucmult.com.br




-- 
Luciano Pacheco
blog.lucmult.com.br


Re: [web2py] Re: cron setup

2012-02-29 Thread Sanjeet Kumar
I have the following code in my crontab :-

0-59/1****root **applications/welcome/cron/test.py

and the following code in my test.py which are inside the cron folder in my
application :-

db.person.insert(name=Alex)

and i want to insert this into the table person which are defined in the
model db.py :-

db.define_table('person', Field('name'))

so please help me through this example how automatically insert/update the
data in database by using cron job.


On Tue, Feb 28, 2012 at 5:10 PM, Sanjeet Kumar sanjeet@gmail.comwrote:

 Thanks Luciano i will try.


 On Tue, Feb 28, 2012 at 5:06 PM, Luciano Pacheco lucm...@gmail.comwrote:

 I have written to you how to do that.

 Copy and paste:

 , but, in the example file, do this changes:

 # file: applications/instore/modules/background_updater.py

 from applications.instore.controllers.default import index

 # instead of time.sleep(5), inside the function main()
 index()

 On Tue, Feb 28, 2012 at 10:33 PM, Sanjeet Kumar sanjeet@gmail.comwrote:

 Yes I want to run the index function of my default controller in a cron
 is this possible or not ?

 On Tue, Feb 28, 2012 at 4:58 PM, Luciano Pacheco lucm...@gmail.comwrote:

 You want to run the index function of your controller in a cron ?

 Usually it doesn't make sense, but, in the example file

 # file: applications/instore/modules/background_updater.py

 from applications.instore.controllers.default import index

 # instead of time.sleep(5), inside the function main()
 index()

 I alson didn't understand what you want, if this doesn't solve your
 question, try explain your use case.

 Regards,


 On Tue, Feb 28, 2012 at 10:00 PM, Sanjeet Kumar 
 sanjeet@gmail.comwrote:

 I am not be able to get you properly can you give me the better
 clarification i have the default controller and the index function can you
 tell me how can i run the index function by using crontab which are in my
 application folder.


 On Tue, Feb 28, 2012 at 4:12 PM, Luciano Pacheco lucm...@gmail.comwrote:

 Following the same example.

 In you controller:

 from applications.instore.modules.background_updater main

 def force_background_updater():
 ret = main()
  return 'The result was: %s' % ret

 But, the cron is run time based tasks, usually those tasks won't be
 used in controller.One exception is when you want to force a task to run.

 Regards,


 On Tue, Feb 28, 2012 at 9:11 PM, Sanjeet Kumar sanjeet@gmail.com
  wrote:

 i tried this but i am not be able to run my controller Can you give
 me the simple example through which i can run the function written under
 the controller inside my application


 On Mon, Feb 27, 2012 at 5:39 PM, Luciano Pacheco 
 lucm...@gmail.comwrote:

 Example:

 http://movu.ca/demo/article/show/31/web2py-cron-task

 My first try in movu.ca :-)


 On Mon, Feb 27, 2012 at 2:32 PM, Sanjeet Kumar 
 sanjeet@gmail.com wrote:

 Exactly I need the examples


 On Mon, Feb 27, 2012 at 4:56 AM, Luciano Pacheco 
 lucm...@gmail.com wrote:

 I think Sanjeet means, I example of the task.

 What is a good practice in the task, or what kind of variables
 are present in the local namespace automagically, etc. A task 
 should be a
 class a function, a python module?

 I had the same question last week when I was reading this
 chapter. :-)

 Regards,
 --
 Luciano Pacheco
 blog.lucmult.com.br

 On Mon, Feb 27, 2012 at 10:08 AM, Alan Etkin 
 spame...@gmail.comwrote:

 It's all in the book (if you haven't seen yet)

 http://web2py.com/books/default/chapter/29/4#Cron

 By the way, The link in web2py to cron (http://web2py.com/books/
 default/reference/29/cronhttp://web2py.com/books/default/reference/29/cron)
 is broken (returns an invalid function
 message)

 On 26 feb, 13:09, Sanjeet Kumar sanjeet@gmail.com wrote:
  Can anyone give me the brief description to how I set the cron
 to run the
  task in background with example.








 --
 Luciano Pacheco
 blog.lucmult.com.br





 --
 Luciano Pacheco
 blog.lucmult.com.br





 --
 Luciano Pacheco
 blog.lucmult.com.br





 --
 Luciano Pacheco
 blog.lucmult.com.br





Re: [web2py] Re: cron setup

2012-02-29 Thread Luciano Pacheco
On Wed, Feb 29, 2012 at 11:10 PM, Sanjeet Kumar sanjeet@gmail.comwrote:

 I have the following code in my crontab :-

 0-59/1****root **applications/welcome/cron/test.py


put just 1 * before applications/

[],
-- 
Luciano Pacheco
blog.lucmult.com.br


Re: [web2py] Re: cron setup

2012-02-29 Thread Sanjeet Kumar
Luciano i removed the one * before the applications and tryed than i got 
the following error :-


OperationalError: unable to open database file
Traceback (most recent call last):
  File /home/tls-sanjeet/Desktop/test/web2py/gluon/restricted.py, line 
204, in restricted
exec ccode in environment
  File applications/welcome/models/db.py, line 14, in module
db = DAL('sqlite://storage.sqlite')
  File /home/tls-sanjeet/Desktop/test/web2py/gluon/dal.py, line 4749, in 
__init__
raise RuntimeError, Failure to connect, tried %d times:\n%s % 
(attempts, tb)
RuntimeError: Failure to connect, tried 5 times:
Traceback (most recent call last):
  File /home/tls-sanjeet/Desktop/test/web2py/gluon/dal.py, line 4736, in 
__init__
self._adapter = ADAPTERS[self._dbname](*args)
  File /home/tls-sanjeet/Desktop/test/web2py/gluon/dal.py, line 1655, in 
__init__
self.pool_connection(connect)
  File /home/tls-sanjeet/Desktop/test/web2py/gluon/dal.py, line 444, in 
pool_connection
self.connection = f()
  File /home/tls-sanjeet/Desktop/test/web2py/gluon/dal.py, line 1654, in 
connect
return self.driver.Connection(dbpath, **driver_args)
OperationalError: unable to open database file


On Wednesday, February 29, 2012 6:39:22 PM UTC+5:30, lucmult wrote:



 On Wed, Feb 29, 2012 at 11:10 PM, Sanjeet Kumar sanjeet@gmail.comwrote:

 I have the following code in my crontab :-

 0-59/1****root **applications/welcome/cron/test.py


 put just 1 * before applications/

 [],
 -- 
 Luciano Pacheco
 blog.lucmult.com.br
  


Re: [web2py] Re: cron setup

2012-02-28 Thread Sanjeet Kumar
i tried this but i am not be able to run my controller Can you give me the
simple example through which i can run the function written under the
controller inside my application

On Mon, Feb 27, 2012 at 5:39 PM, Luciano Pacheco lucm...@gmail.com wrote:

 Example:

 http://movu.ca/demo/article/show/31/web2py-cron-task

 My first try in movu.ca :-)


 On Mon, Feb 27, 2012 at 2:32 PM, Sanjeet Kumar sanjeet@gmail.comwrote:

 Exactly I need the examples


 On Mon, Feb 27, 2012 at 4:56 AM, Luciano Pacheco lucm...@gmail.comwrote:

 I think Sanjeet means, I example of the task.

 What is a good practice in the task, or what kind of variables are
 present in the local namespace automagically, etc. A task should be a
 class a function, a python module?

 I had the same question last week when I was reading this chapter. :-)

 Regards,
 --
 Luciano Pacheco
 blog.lucmult.com.br

 On Mon, Feb 27, 2012 at 10:08 AM, Alan Etkin spame...@gmail.com wrote:

 It's all in the book (if you haven't seen yet)

 http://web2py.com/books/default/chapter/29/4#Cron

 By the way, The link in web2py to cron (http://web2py.com/books/
 default/reference/29/cronhttp://web2py.com/books/default/reference/29/cron)
 is broken (returns an invalid function
 message)

 On 26 feb, 13:09, Sanjeet Kumar sanjeet@gmail.com wrote:
  Can anyone give me the brief description to how I set the cron to run
 the
  task in background with example.








 --
 Luciano Pacheco
 blog.lucmult.com.br



Re: [web2py] Re: cron setup

2012-02-28 Thread Luciano Pacheco
Following the same example.

In you controller:

from applications.instore.modules.background_updater main

def force_background_updater():
ret = main()
return 'The result was: %s' % ret

But, the cron is run time based tasks, usually those tasks won't be used in
controller.One exception is when you want to force a task to run.

Regards,

On Tue, Feb 28, 2012 at 9:11 PM, Sanjeet Kumar sanjeet@gmail.comwrote:

 i tried this but i am not be able to run my controller Can you give me the
 simple example through which i can run the function written under the
 controller inside my application


 On Mon, Feb 27, 2012 at 5:39 PM, Luciano Pacheco lucm...@gmail.comwrote:

 Example:

 http://movu.ca/demo/article/show/31/web2py-cron-task

 My first try in movu.ca :-)


 On Mon, Feb 27, 2012 at 2:32 PM, Sanjeet Kumar sanjeet@gmail.comwrote:

 Exactly I need the examples


 On Mon, Feb 27, 2012 at 4:56 AM, Luciano Pacheco lucm...@gmail.comwrote:

 I think Sanjeet means, I example of the task.

 What is a good practice in the task, or what kind of variables are
 present in the local namespace automagically, etc. A task should be a
 class a function, a python module?

 I had the same question last week when I was reading this chapter. :-)

 Regards,
 --
 Luciano Pacheco
 blog.lucmult.com.br

 On Mon, Feb 27, 2012 at 10:08 AM, Alan Etkin spame...@gmail.comwrote:

 It's all in the book (if you haven't seen yet)

 http://web2py.com/books/default/chapter/29/4#Cron

 By the way, The link in web2py to cron (http://web2py.com/books/
 default/reference/29/cronhttp://web2py.com/books/default/reference/29/cron)
 is broken (returns an invalid function
 message)

 On 26 feb, 13:09, Sanjeet Kumar sanjeet@gmail.com wrote:
  Can anyone give me the brief description to how I set the cron to
 run the
  task in background with example.








 --
 Luciano Pacheco
 blog.lucmult.com.br





-- 
Luciano Pacheco
blog.lucmult.com.br


Re: [web2py] Re: cron setup

2012-02-28 Thread Sanjeet Kumar
I am not be able to get you properly can you give me the better
clarification i have the default controller and the index function can you
tell me how can i run the index function by using crontab which are in my
application folder.

On Tue, Feb 28, 2012 at 4:12 PM, Luciano Pacheco lucm...@gmail.com wrote:

 Following the same example.

 In you controller:

 from applications.instore.modules.background_updater main

 def force_background_updater():
 ret = main()
 return 'The result was: %s' % ret

 But, the cron is run time based tasks, usually those tasks won't be used
 in controller.One exception is when you want to force a task to run.

 Regards,


 On Tue, Feb 28, 2012 at 9:11 PM, Sanjeet Kumar sanjeet@gmail.comwrote:

 i tried this but i am not be able to run my controller Can you give me
 the simple example through which i can run the function written under the
 controller inside my application


 On Mon, Feb 27, 2012 at 5:39 PM, Luciano Pacheco lucm...@gmail.comwrote:

 Example:

 http://movu.ca/demo/article/show/31/web2py-cron-task

 My first try in movu.ca :-)


 On Mon, Feb 27, 2012 at 2:32 PM, Sanjeet Kumar sanjeet@gmail.comwrote:

 Exactly I need the examples


 On Mon, Feb 27, 2012 at 4:56 AM, Luciano Pacheco lucm...@gmail.comwrote:

 I think Sanjeet means, I example of the task.

 What is a good practice in the task, or what kind of variables are
 present in the local namespace automagically, etc. A task should be a
 class a function, a python module?

 I had the same question last week when I was reading this chapter. :-)

 Regards,
 --
 Luciano Pacheco
 blog.lucmult.com.br

 On Mon, Feb 27, 2012 at 10:08 AM, Alan Etkin spame...@gmail.comwrote:

 It's all in the book (if you haven't seen yet)

 http://web2py.com/books/default/chapter/29/4#Cron

 By the way, The link in web2py to cron (http://web2py.com/books/
 default/reference/29/cronhttp://web2py.com/books/default/reference/29/cron)
 is broken (returns an invalid function
 message)

 On 26 feb, 13:09, Sanjeet Kumar sanjeet@gmail.com wrote:
  Can anyone give me the brief description to how I set the cron to
 run the
  task in background with example.








 --
 Luciano Pacheco
 blog.lucmult.com.br





 --
 Luciano Pacheco
 blog.lucmult.com.br



Re: [web2py] Re: cron setup

2012-02-28 Thread Luciano Pacheco
You want to run the index function of your controller in a cron ?

Usually it doesn't make sense, but, in the example file

# file: applications/instore/modules/background_updater.py

from applications.instore.controllers.default import index

# instead of time.sleep(5), inside the function main()
index()

I alson didn't understand what you want, if this doesn't solve your
question, try explain your use case.

Regards,

On Tue, Feb 28, 2012 at 10:00 PM, Sanjeet Kumar sanjeet@gmail.comwrote:

 I am not be able to get you properly can you give me the better
 clarification i have the default controller and the index function can you
 tell me how can i run the index function by using crontab which are in my
 application folder.


 On Tue, Feb 28, 2012 at 4:12 PM, Luciano Pacheco lucm...@gmail.comwrote:

 Following the same example.

 In you controller:

 from applications.instore.modules.background_updater main

 def force_background_updater():
 ret = main()
  return 'The result was: %s' % ret

 But, the cron is run time based tasks, usually those tasks won't be used
 in controller.One exception is when you want to force a task to run.

 Regards,


 On Tue, Feb 28, 2012 at 9:11 PM, Sanjeet Kumar sanjeet@gmail.comwrote:

 i tried this but i am not be able to run my controller Can you give me
 the simple example through which i can run the function written under the
 controller inside my application


 On Mon, Feb 27, 2012 at 5:39 PM, Luciano Pacheco lucm...@gmail.comwrote:

 Example:

 http://movu.ca/demo/article/show/31/web2py-cron-task

 My first try in movu.ca :-)


 On Mon, Feb 27, 2012 at 2:32 PM, Sanjeet Kumar 
 sanjeet@gmail.comwrote:

 Exactly I need the examples


 On Mon, Feb 27, 2012 at 4:56 AM, Luciano Pacheco lucm...@gmail.comwrote:

 I think Sanjeet means, I example of the task.

 What is a good practice in the task, or what kind of variables are
 present in the local namespace automagically, etc. A task should be a
 class a function, a python module?

 I had the same question last week when I was reading this chapter. :-)

 Regards,
 --
 Luciano Pacheco
 blog.lucmult.com.br

 On Mon, Feb 27, 2012 at 10:08 AM, Alan Etkin spame...@gmail.comwrote:

 It's all in the book (if you haven't seen yet)

 http://web2py.com/books/default/chapter/29/4#Cron

 By the way, The link in web2py to cron (http://web2py.com/books/
 default/reference/29/cronhttp://web2py.com/books/default/reference/29/cron)
 is broken (returns an invalid function
 message)

 On 26 feb, 13:09, Sanjeet Kumar sanjeet@gmail.com wrote:
  Can anyone give me the brief description to how I set the cron to
 run the
  task in background with example.








 --
 Luciano Pacheco
 blog.lucmult.com.br





 --
 Luciano Pacheco
 blog.lucmult.com.br





-- 
Luciano Pacheco
blog.lucmult.com.br


Re: [web2py] Re: cron setup

2012-02-28 Thread Sanjeet Kumar
Yes I want to run the index function of my default controller in a cron is
this possible or not ?

On Tue, Feb 28, 2012 at 4:58 PM, Luciano Pacheco lucm...@gmail.com wrote:

 You want to run the index function of your controller in a cron ?

 Usually it doesn't make sense, but, in the example file

 # file: applications/instore/modules/background_updater.py

 from applications.instore.controllers.default import index

 # instead of time.sleep(5), inside the function main()
 index()

 I alson didn't understand what you want, if this doesn't solve your
 question, try explain your use case.

 Regards,


 On Tue, Feb 28, 2012 at 10:00 PM, Sanjeet Kumar sanjeet@gmail.comwrote:

 I am not be able to get you properly can you give me the better
 clarification i have the default controller and the index function can you
 tell me how can i run the index function by using crontab which are in my
 application folder.


 On Tue, Feb 28, 2012 at 4:12 PM, Luciano Pacheco lucm...@gmail.comwrote:

 Following the same example.

 In you controller:

 from applications.instore.modules.background_updater main

 def force_background_updater():
 ret = main()
  return 'The result was: %s' % ret

 But, the cron is run time based tasks, usually those tasks won't be used
 in controller.One exception is when you want to force a task to run.

 Regards,


 On Tue, Feb 28, 2012 at 9:11 PM, Sanjeet Kumar sanjeet@gmail.comwrote:

 i tried this but i am not be able to run my controller Can you give me
 the simple example through which i can run the function written under the
 controller inside my application


 On Mon, Feb 27, 2012 at 5:39 PM, Luciano Pacheco lucm...@gmail.comwrote:

 Example:

 http://movu.ca/demo/article/show/31/web2py-cron-task

 My first try in movu.ca :-)


 On Mon, Feb 27, 2012 at 2:32 PM, Sanjeet Kumar 
 sanjeet@gmail.comwrote:

 Exactly I need the examples


 On Mon, Feb 27, 2012 at 4:56 AM, Luciano Pacheco 
 lucm...@gmail.comwrote:

 I think Sanjeet means, I example of the task.

 What is a good practice in the task, or what kind of variables are
 present in the local namespace automagically, etc. A task should be a
 class a function, a python module?

 I had the same question last week when I was reading this chapter.
 :-)

 Regards,
 --
 Luciano Pacheco
 blog.lucmult.com.br

 On Mon, Feb 27, 2012 at 10:08 AM, Alan Etkin spame...@gmail.comwrote:

 It's all in the book (if you haven't seen yet)

 http://web2py.com/books/default/chapter/29/4#Cron

 By the way, The link in web2py to cron (http://web2py.com/books/
 default/reference/29/cronhttp://web2py.com/books/default/reference/29/cron)
 is broken (returns an invalid function
 message)

 On 26 feb, 13:09, Sanjeet Kumar sanjeet@gmail.com wrote:
  Can anyone give me the brief description to how I set the cron to
 run the
  task in background with example.








 --
 Luciano Pacheco
 blog.lucmult.com.br





 --
 Luciano Pacheco
 blog.lucmult.com.br





 --
 Luciano Pacheco
 blog.lucmult.com.br



Re: [web2py] Re: cron setup

2012-02-28 Thread Luciano Pacheco
I have written to you how to do that.

Copy and paste:

, but, in the example file, do this changes:

# file: applications/instore/modules/background_updater.py

from applications.instore.controllers.default import index

# instead of time.sleep(5), inside the function main()
index()

On Tue, Feb 28, 2012 at 10:33 PM, Sanjeet Kumar sanjeet@gmail.comwrote:

 Yes I want to run the index function of my default controller in a cron is
 this possible or not ?

 On Tue, Feb 28, 2012 at 4:58 PM, Luciano Pacheco lucm...@gmail.comwrote:

 You want to run the index function of your controller in a cron ?

 Usually it doesn't make sense, but, in the example file

 # file: applications/instore/modules/background_updater.py

 from applications.instore.controllers.default import index

 # instead of time.sleep(5), inside the function main()
 index()

 I alson didn't understand what you want, if this doesn't solve your
 question, try explain your use case.

 Regards,


 On Tue, Feb 28, 2012 at 10:00 PM, Sanjeet Kumar sanjeet@gmail.comwrote:

 I am not be able to get you properly can you give me the better
 clarification i have the default controller and the index function can you
 tell me how can i run the index function by using crontab which are in my
 application folder.


 On Tue, Feb 28, 2012 at 4:12 PM, Luciano Pacheco lucm...@gmail.comwrote:

 Following the same example.

 In you controller:

 from applications.instore.modules.background_updater main

 def force_background_updater():
 ret = main()
  return 'The result was: %s' % ret

 But, the cron is run time based tasks, usually those tasks won't be
 used in controller.One exception is when you want to force a task to run.

 Regards,


 On Tue, Feb 28, 2012 at 9:11 PM, Sanjeet Kumar 
 sanjeet@gmail.comwrote:

 i tried this but i am not be able to run my controller Can you give me
 the simple example through which i can run the function written under the
 controller inside my application


 On Mon, Feb 27, 2012 at 5:39 PM, Luciano Pacheco lucm...@gmail.comwrote:

 Example:

 http://movu.ca/demo/article/show/31/web2py-cron-task

 My first try in movu.ca :-)


 On Mon, Feb 27, 2012 at 2:32 PM, Sanjeet Kumar sanjeet@gmail.com
  wrote:

 Exactly I need the examples


 On Mon, Feb 27, 2012 at 4:56 AM, Luciano Pacheco 
 lucm...@gmail.comwrote:

 I think Sanjeet means, I example of the task.

 What is a good practice in the task, or what kind of variables are
 present in the local namespace automagically, etc. A task should be a
 class a function, a python module?

 I had the same question last week when I was reading this chapter.
 :-)

 Regards,
 --
 Luciano Pacheco
 blog.lucmult.com.br

 On Mon, Feb 27, 2012 at 10:08 AM, Alan Etkin spame...@gmail.comwrote:

 It's all in the book (if you haven't seen yet)

 http://web2py.com/books/default/chapter/29/4#Cron

 By the way, The link in web2py to cron (http://web2py.com/books/
 default/reference/29/cronhttp://web2py.com/books/default/reference/29/cron)
 is broken (returns an invalid function
 message)

 On 26 feb, 13:09, Sanjeet Kumar sanjeet@gmail.com wrote:
  Can anyone give me the brief description to how I set the cron
 to run the
  task in background with example.








 --
 Luciano Pacheco
 blog.lucmult.com.br





 --
 Luciano Pacheco
 blog.lucmult.com.br





 --
 Luciano Pacheco
 blog.lucmult.com.br





-- 
Luciano Pacheco
blog.lucmult.com.br


Re: [web2py] Re: cron setup

2012-02-28 Thread Sanjeet Kumar
Thanks Luciano i will try.

On Tue, Feb 28, 2012 at 5:06 PM, Luciano Pacheco lucm...@gmail.com wrote:

 I have written to you how to do that.

 Copy and paste:

 , but, in the example file, do this changes:

 # file: applications/instore/modules/background_updater.py

 from applications.instore.controllers.default import index

 # instead of time.sleep(5), inside the function main()
 index()

 On Tue, Feb 28, 2012 at 10:33 PM, Sanjeet Kumar sanjeet@gmail.comwrote:

 Yes I want to run the index function of my default controller in a cron
 is this possible or not ?

 On Tue, Feb 28, 2012 at 4:58 PM, Luciano Pacheco lucm...@gmail.comwrote:

 You want to run the index function of your controller in a cron ?

 Usually it doesn't make sense, but, in the example file

 # file: applications/instore/modules/background_updater.py

 from applications.instore.controllers.default import index

 # instead of time.sleep(5), inside the function main()
 index()

 I alson didn't understand what you want, if this doesn't solve your
 question, try explain your use case.

 Regards,


 On Tue, Feb 28, 2012 at 10:00 PM, Sanjeet Kumar 
 sanjeet@gmail.comwrote:

 I am not be able to get you properly can you give me the better
 clarification i have the default controller and the index function can you
 tell me how can i run the index function by using crontab which are in my
 application folder.


 On Tue, Feb 28, 2012 at 4:12 PM, Luciano Pacheco lucm...@gmail.comwrote:

 Following the same example.

 In you controller:

 from applications.instore.modules.background_updater main

 def force_background_updater():
 ret = main()
  return 'The result was: %s' % ret

 But, the cron is run time based tasks, usually those tasks won't be
 used in controller.One exception is when you want to force a task to run.

 Regards,


 On Tue, Feb 28, 2012 at 9:11 PM, Sanjeet Kumar 
 sanjeet@gmail.comwrote:

 i tried this but i am not be able to run my controller Can you give
 me the simple example through which i can run the function written under
 the controller inside my application


 On Mon, Feb 27, 2012 at 5:39 PM, Luciano Pacheco 
 lucm...@gmail.comwrote:

 Example:

 http://movu.ca/demo/article/show/31/web2py-cron-task

 My first try in movu.ca :-)


 On Mon, Feb 27, 2012 at 2:32 PM, Sanjeet Kumar 
 sanjeet@gmail.com wrote:

 Exactly I need the examples


 On Mon, Feb 27, 2012 at 4:56 AM, Luciano Pacheco lucm...@gmail.com
  wrote:

 I think Sanjeet means, I example of the task.

 What is a good practice in the task, or what kind of variables are
 present in the local namespace automagically, etc. A task should be 
 a
 class a function, a python module?

 I had the same question last week when I was reading this chapter.
 :-)

 Regards,
 --
 Luciano Pacheco
 blog.lucmult.com.br

 On Mon, Feb 27, 2012 at 10:08 AM, Alan Etkin 
 spame...@gmail.comwrote:

 It's all in the book (if you haven't seen yet)

 http://web2py.com/books/default/chapter/29/4#Cron

 By the way, The link in web2py to cron (http://web2py.com/books/
 default/reference/29/cronhttp://web2py.com/books/default/reference/29/cron)
 is broken (returns an invalid function
 message)

 On 26 feb, 13:09, Sanjeet Kumar sanjeet@gmail.com wrote:
  Can anyone give me the brief description to how I set the cron
 to run the
  task in background with example.








 --
 Luciano Pacheco
 blog.lucmult.com.br





 --
 Luciano Pacheco
 blog.lucmult.com.br





 --
 Luciano Pacheco
 blog.lucmult.com.br





 --
 Luciano Pacheco
 blog.lucmult.com.br



Re: [web2py] Re: cron setup

2012-02-27 Thread Luciano Pacheco
Example:

http://movu.ca/demo/article/show/31/web2py-cron-task

My first try in movu.ca :-)

On Mon, Feb 27, 2012 at 2:32 PM, Sanjeet Kumar sanjeet@gmail.comwrote:

 Exactly I need the examples


 On Mon, Feb 27, 2012 at 4:56 AM, Luciano Pacheco lucm...@gmail.comwrote:

 I think Sanjeet means, I example of the task.

 What is a good practice in the task, or what kind of variables are
 present in the local namespace automagically, etc. A task should be a
 class a function, a python module?

 I had the same question last week when I was reading this chapter. :-)

 Regards,
 --
 Luciano Pacheco
 blog.lucmult.com.br

 On Mon, Feb 27, 2012 at 10:08 AM, Alan Etkin spame...@gmail.com wrote:

 It's all in the book (if you haven't seen yet)

 http://web2py.com/books/default/chapter/29/4#Cron

 By the way, The link in web2py to cron (http://web2py.com/books/
 default/reference/29/cronhttp://web2py.com/books/default/reference/29/cron)
 is broken (returns an invalid function
 message)

 On 26 feb, 13:09, Sanjeet Kumar sanjeet@gmail.com wrote:
  Can anyone give me the brief description to how I set the cron to run
 the
  task in background with example.








-- 
Luciano Pacheco
blog.lucmult.com.br


Re: [web2py] Re: cron setup

2012-02-27 Thread Bruno Rocha
thanks Luciano! I will migrate your recipe to the new web2pyslices website.

http://zerp.ly/rochacbruno
Em 27/02/2012 09:16, Luciano Pacheco lucm...@gmail.com escreveu:

 Example:

 http://movu.ca/demo/article/show/31/web2py-cron-task

 My first try in movu.ca :-)

 On Mon, Feb 27, 2012 at 2:32 PM, Sanjeet Kumar sanjeet@gmail.comwrote:

 Exactly I need the examples


 On Mon, Feb 27, 2012 at 4:56 AM, Luciano Pacheco lucm...@gmail.comwrote:

 I think Sanjeet means, I example of the task.

 What is a good practice in the task, or what kind of variables are
 present in the local namespace automagically, etc. A task should be a
 class a function, a python module?

 I had the same question last week when I was reading this chapter. :-)

 Regards,
 --
 Luciano Pacheco
 blog.lucmult.com.br

 On Mon, Feb 27, 2012 at 10:08 AM, Alan Etkin spame...@gmail.com wrote:

 It's all in the book (if you haven't seen yet)

 http://web2py.com/books/default/chapter/29/4#Cron

 By the way, The link in web2py to cron (http://web2py.com/books/
 default/reference/29/cronhttp://web2py.com/books/default/reference/29/cron)
 is broken (returns an invalid function
 message)

 On 26 feb, 13:09, Sanjeet Kumar sanjeet@gmail.com wrote:
  Can anyone give me the brief description to how I set the cron to run
 the
  task in background with example.








 --
 Luciano Pacheco
 blog.lucmult.com.br



[web2py] Re: cron setup

2012-02-26 Thread Alan Etkin
It's all in the book (if you haven't seen yet)

http://web2py.com/books/default/chapter/29/4#Cron

By the way, The link in web2py to cron (http://web2py.com/books/
default/reference/29/cron) is broken (returns an invalid function
message)

On 26 feb, 13:09, Sanjeet Kumar sanjeet@gmail.com wrote:
 Can anyone give me the brief description to how I set the cron to run the
 task in background with example.


Re: [web2py] Re: cron setup

2012-02-26 Thread Luciano Pacheco
I think Sanjeet means, I example of the task.

What is a good practice in the task, or what kind of variables are present
in the local namespace automagically, etc. A task should be a class a
function, a python module?

I had the same question last week when I was reading this chapter. :-)

Regards,
-- 
Luciano Pacheco
blog.lucmult.com.br

On Mon, Feb 27, 2012 at 10:08 AM, Alan Etkin spame...@gmail.com wrote:

 It's all in the book (if you haven't seen yet)

 http://web2py.com/books/default/chapter/29/4#Cron

 By the way, The link in web2py to cron (http://web2py.com/books/
 default/reference/29/cron) is broken (returns an invalid function
 message)

 On 26 feb, 13:09, Sanjeet Kumar sanjeet@gmail.com wrote:
  Can anyone give me the brief description to how I set the cron to run the
  task in background with example.



[web2py] Re: cron setup

2012-02-26 Thread Anthony


 By the way, The link in web2py to cron (http://web2py.com/books/ 
 default/reference/29/cronhttp://web2py.com/books/default/reference/29/cron) 
 is broken (returns an invalid function 
 message) 


Actually, there's a bug in the book app -- all the reference links are 
broken.


Re: [web2py] Re: cron setup

2012-02-26 Thread Sanjeet Kumar
Exactly I need the examples

On Mon, Feb 27, 2012 at 4:56 AM, Luciano Pacheco lucm...@gmail.com wrote:

 I think Sanjeet means, I example of the task.

 What is a good practice in the task, or what kind of variables are present
 in the local namespace automagically, etc. A task should be a class a
 function, a python module?

 I had the same question last week when I was reading this chapter. :-)

 Regards,
 --
 Luciano Pacheco
 blog.lucmult.com.br

 On Mon, Feb 27, 2012 at 10:08 AM, Alan Etkin spame...@gmail.com wrote:

 It's all in the book (if you haven't seen yet)

 http://web2py.com/books/default/chapter/29/4#Cron

 By the way, The link in web2py to cron (http://web2py.com/books/
 default/reference/29/cronhttp://web2py.com/books/default/reference/29/cron)
 is broken (returns an invalid function
 message)

 On 26 feb, 13:09, Sanjeet Kumar sanjeet@gmail.com wrote:
  Can anyone give me the brief description to how I set the cron to run
 the
  task in background with example.