I have a python script which queries a TimesTen database and stores the output in a file, and emails it off. When I run it from its directory /home/directory/script.py, it works absolutely fine and pulls the data from the TimesTen db to a text file as instructed.
However, when I put it in cron, the python script still runs and doesn't error. The issue is that the output files are blank, which isn't the case when run normally.
The crontab entry is as follows:
05 14 * * * /usr/bin/python /export/home/user/script/bin/script.py
Does TimesTen db not run with cron or am I missing something very obvious? Do I need to put the absolute path of TimesTen when running the command? Such as:
os.system('/path/to/TimesTen/ttIsqlCS -f file.txt dsn=dsn > output.txt')
At the moment in my python script I run the TimesTen query as:
os.system('ttIsqlCS -f file.txt dsn=dsn > output.txt')
Any help would be appreciated.
Thanks in advance.