Running Python script from crontab doesn't display
Posted: Sat Apr 18, 2020 8:01 pm
Re-writing some Bash scripts in Python, the following Bash script:
displays on the console when run manually in /home AND when the Bash
script is called by sudo crontab.
However, if I use this Python script:
it displays "test" when run from /home BUT not when the Python script
is called by sudo crontab
I have tried user crontab and it still doesn't work. There seems to be
something different when running a Python script from crontab.
Appreciate any clues.
Code: Select all
echo "test" >> /dev/tty1
displays on the console when run manually in /home AND when the Bash
script is called by sudo crontab.
However, if I use this Python script:
Code: Select all
#!/usr/bin/python3
import sys
sys.stdout.write("test")
sys.stdout.flush()
is called by sudo crontab
I have tried user crontab and it still doesn't work. There seems to be
something different when running a Python script from crontab.
Appreciate any clues.