I have a "long" python script that runs approximately 45 [min]. I am using another (“scheduler” script) python script to run this long script. When I run the "scheduler" script using the terminal, everything works fine (this means that the "long" script works without any problems).
I had some struggle, but in the end I managed to add a “scheduler” script to run through cron every minute. so now it "runs" another script and works fine.
Here is the problem: whenever a script (which is run by the "scheduler") has a line that reads:
print "hello"
or any print statement, the cron job starts, but ends after 20-30 seconds. When I delete any print statements, cron starts jobs normally and does not interrupt.
I would like to correct this situation, and the scripts continue to work, even if they have some kind of "print" expression. any clues how to do this?
PS from the "planner" I use
subprocess.Popen([sys.executable, command])
to run all other python scripts.
source share