-2

I have a script (/home/user/script.sh):

#!/bin/bash
/usr/bin/python /home/user/program.py >> /home/user/logs/out.log &

and it is working. The output from the python script is written to the out.log file. Now I am adding the script to cron:

*/1 * * * * /home/user/script.sh

Restarting cron and nothing is written to the out.log file. Cron is running and executing the script every 1 minute.

Why it's not working?

inq93
  • 1
  • 1

1 Answers1

0

The prefered way to do this is to use pythons logging module and write directly from inside the script instead of redirecting the output.

mzhaase
  • 3,798
  • 2
  • 20
  • 32