I have a 'long' python script that takes roughly 45[min] to run. I use another (a 'scheduler' script) python script to run this long script. When I run the 'scheduler' script using the terminal, everything works perfectly (meaning, the 'long' script runs without any issues).
I had some struggles, but eventually succeeded adding the 'scheduler' script to run through cron every minute. so it now 'runs' other script and works OK.
Here is the problem: whenever a script (that is being 'run' by the 'scheduler') has a line that says:
print "hello"
or any 'print' statement, the cron job runs, but terminates after 20-30 seconds. When I remove any 'print' statements, cron runs the jobs normally and does not terminate.
I'd like to fix this situation, and have the scripts continue to run even if they have some 'print' statements in them. any hints how to do it?
P.S. from within the 'scheduler', I use
subprocess.Popen([sys.executable, command])
to 'run' all other python scripts.