I have a shell script that works fine when run manually, but fails when run through the crontab. The script essentially does as follows:
Python script to get audio data and pipe to stdout | ffmpeg the data from stdin and pipe to stdout | stream the data from stdin
When run through crontab the streaming fails, complaining that there is no data at stdin (
...No (more) data available on standard input).
I found this answer which seems to allude to the issue of file descriptors in crontab, but I would appreciate some more details on the problem and the best way to get around it.
EDIT: Troubleshooting the issue by trying each individual command separately shows that the issue starts in the python script which complains:
close failed in file object destructor: sys.excepthook is missing lost sys.stderr"
Traceback (most recent call last): File "/home/*username*/testing.py", line 109, in <module> sys.stdout.flush() IOError: [Errno 9] Bad file descriptor
So perhaps it's more of a python issue..though from the error it stil seems to have to do with stdin/stdout