Forums

Running Scheduled Script for Web2py

I am trying to run a script that I have in my app. While the log files seem to show my script ran, it does not update the db I have for my app. On the schedule tab in pythonanywhere I have this set up so not sure if it is correct:

python2.7 /home/tsrdatatech/web2py/web2py.py -S ttheorydataextractor -M -R /home/tsrdatatech/web2py/applications/ttheorydataextractor/modules/voltrin_grabber.py

And a sample output of what the log says when it runs is below:

2014-07-14 23:00:44 -- Completed task, took 17.00 seconds, return code was 0. web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2014 Version 2.9.5-stable+timestamp.2014.03.16.02.35.39 Database drivers available: SQLite(sqlite3), MySQL(pymysql), MySQL(MySQLdb), MySQL(mysqlconnector), PostgreSQL(psycopg2), PostgreSQL(pg8000), MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyodbc), MongoDB(pymongo), IMAP(imaplib)

2014-07-15 23:00:30 -- Completed task, took 11.00 seconds, return code was 0.

It seems like it opens web2py but doesnt really run the script I have I think.

Thanks.

Have you tried running it in a console? Perhaps the web2py runner is eating exceptions or something. Another thing to try would be to drop in some prints. If the web2py runner doesn't eat them, they will appear in the task log.

Thanks. It was my fault it did not run correctly, working now.