In a model:

from gluon.scheduler import Scheduler
def mytask():
       # do something
       return
scheduler=Scheduler(db,tasks=dict(mytask=mytask)
if db(db.scheduler_task).isempty():
      db.scheduler_task.insert(
            application_name = 'yourapp',
            task_name = 'mytask',
            function_name = 'mytask',
            repeats = 0, # unilimted
            period = 24*3600) # seconds

Then from the shell run

python web2py.py -K yourapp

this will create a background process which picks and runs the scheduled 
tasks. You can monitor tasks using appadmin.


On Monday, 21 May 2012 08:30:37 UTC-5, Hassan Alnatour wrote:
>
> Can you Please Show me An Example Or Something , I cant understand  it 
>
>
> Best Regards,
>

Reply via email to