Forums

Database not found when running a script from the schedule tab

Hi,

My script works perfectly if I just do "python wxadvisory.py".

However, when running it from a schedule tab I get the following error:

Traceback (most recent call last):
File "/home/Manuito/safetybot/wxadvisory/wxadvisory.py", line 18, in <module>
cur.execute("SELECT * FROM Airports ORDER BY Id ASC")
sqlite3.OperationalError: no such table: Airports

2014-02-07 08:29:06 -- Completed task, took 2.00 seconds, return code was 1.

Any idea why this could be happening?

Thanks a lot!

You're probably using a relative path for your database file. Scheduled tasks don't magically know which path to use as the current path (if I remember correctly, they just use your home directory) You need to use an absolute path in your Python program.