Help starting web2py Cron Task for the first time

I run web2py locally with Windows 7 and live on a Linux Ubuntu server, and I was not able to run the cron job.

My crontab is as follows:

*/1 * * * * root *autoemail/send_autoemails 

and my function works fine when called manually. It also ends

db.commit()

Other than that, I don’t know what else to do if it works, although I really did not understand the entire section of the web2py book on Cron, especially when it came to soft / hard / external cron and all that.

I saw a web2py stream that may have replaced cron?

Maybe this has something to do with this? Is there anything else I need to do to configure cron before it works?

Any ideas on how I can fix this problem are greatly appreciated.

+5
1

web2py Cron Scheduler, web2py Cron .

, , Scheduler:

# New File applications/yourapp/models/zfunctions.py
#
def send_autoemails():
    ...
    ...#Your code here
    ...
    ...

from gluon.scheduler import Scheduler
Scheduler(db,dict(yourfunction=send_autoemails)) 


web2py db, db.task_scheduled task_scheduled , , -, , ..

: http://web2py.com/book/default/chapter/04#Scheduler-(experimental)

+4

All Articles