Featured post
linux - Cron Terminates Python Script? -
i have 'long' python script takes 45[min] run. use (a 'scheduler' script) python script run long script. when run 'scheduler' script using terminal, works (meaning, 'long' script runs without issues).
i had struggles, succeeded adding 'scheduler' script run through cron every minute. 'runs' other script , works ok.
here problem: whenever script (that being 'run' 'scheduler') has line says:
print "hello"
or 'print' statement, cron job runs, terminates after 20-30 seconds. when remove 'print' statements, cron runs jobs , not terminate.
i'd fix situation, , have scripts continue run if have 'print' statements in them. hints how it?
p.s. within 'scheduler', use
subprocess.popen([sys.executable, command])
to 'run' other python scripts.
i have hunch it's due way cron
handles stdout. how redirecting output?
from http://aplawrence.com/bdd/bbcronbasics.html:
output
normally output of program sent stdout (standard out) , winds on someone's display screen. jobs started cron, stdout directed local mail subsystem, means output generated cron job mailed user owning job. if not desirable should take steps redirect cron job's output file. suggested redirect stderr (standard error) file able analyze anomalies in cron job's execution.
- Get link
- X
- Other Apps
Comments
Post a Comment