0

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.

2
  • where is ttIsqlCS located? Commented Aug 5, 2021 at 13:59
  • so it's located in /os/local/TimesTen/version/bin/ttIsqlCS, and my script is located in /os/home/user/scriptname/bin/script.py Commented Aug 5, 2021 at 14:42

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.