I have made an extensive script that runs fine when started from the command line or IDLE. But when I try to run it with cron it keeps giving errors: IOError: [Errno 32] Broken pipe
1 Answer
If your script runs too long, cron will close its stdout/stderr that are normally redirected to a log file (through cron). Attempting to print after the timeout will give you broken pipe.
A solution is to use logging or print only to your own log files and never to stdout.
Also, cron has different envinronment, specified at the top of crontab or cron.(daily|hourly|...) files. Make sure it is correct, especially if you rely on PATH or HOME that are set at login.