I have a sqlite query written in python: dibbs5.py
cursor.executemany ( """
INSERT INTO dibbs_spider_dibbs_fields(hash,nsn,nomenclature,technical_documents,solicitation,
status,purchase_request,issued,return_by,file)
VALUES (?,?,?,?,?,?,?,?,?,?)
""" , records )
This works fine in local, in production when I execute this from terminal, it executes. But when I schedule this in cronjob, it shows the error:
cursor.executemany ( """
sqlite3.OperationalError: no such table: dibbs_spider_dibbs_fields
There is a table name dibbs_spider_dibbs_fields
Crontab:
31 09 * * * /usr/bin/python3 /root/spider/manage.py makemigrations > /root/spider/migration.log 2>&1
32 09 * * * /usr/bin/python3 /root/spider/manage.py migrate > /root/spider/migration2.log 2>&1
33 09 * * * DISPLAY=:0 /usr/bin/python3 /root/spider/dibbs5.py > /root/spider/dibbserorr3.log 2>&1
from SQLite query not working in cronjob(Production)?
No comments:
Post a Comment