I have a command in crontab as follows : * /5 0-23 * * * /home/pi/refresh.sh
refresh.sh contains the following two lines and is executed every 5 minutes:
line1 contains: /usr/bin/sudo pkill -F /home/pi/metarpid.pid (purpose is to stop the currently executing metar.py )
line2 contains: /usr/bin/sudo python3 /home/pi/metar.py & echo $! > /home/pi/metarpid.pid (purpose is to re-start metar.py and place its new pid in the file metarpid.pid)
Every 5 minutes, the crontab job runs the commands in refresh.sh to kill the running process of metar.py and the second line is used to start metar.py back running.
Every 5 minutes I get the following 2 lines of output from cron output from syslog using: tail -f /var/log/syslog | grep CRON
Jun 11 15:55:01 metar4 CRON[2138]: (pi) CMD (/home/pi/refresh.sh)
Jun 11 15:55:01 metar4 [2144] (CRON) info (No MTA installed, disregarding output)
metar4 is the raspberry pi hostname.
When the CRON job runs, the program metar.py does not start and the file metarpid.pid is not created and placed in /home/pi as expected.
However, if I type the contents of line 2 in in a terminal window, the metar.py program starts running and metarpid.pid is created in /home/pi as expected.
I do not understand why the crontab command is getting the MTA error which I would think is why metar.py does not start and its pid file not placed in /home/pi.
I am not using email either, which is what I think MTA is referring.
refresh.sh contains the following two lines and is executed every 5 minutes:
line1 contains: /usr/bin/sudo pkill -F /home/pi/metarpid.pid (purpose is to stop the currently executing metar.py )
line2 contains: /usr/bin/sudo python3 /home/pi/metar.py & echo $! > /home/pi/metarpid.pid (purpose is to re-start metar.py and place its new pid in the file metarpid.pid)
Every 5 minutes, the crontab job runs the commands in refresh.sh to kill the running process of metar.py and the second line is used to start metar.py back running.
Every 5 minutes I get the following 2 lines of output from cron output from syslog using: tail -f /var/log/syslog | grep CRON
Jun 11 15:55:01 metar4 CRON[2138]: (pi) CMD (/home/pi/refresh.sh)
Jun 11 15:55:01 metar4 [2144] (CRON) info (No MTA installed, disregarding output)
metar4 is the raspberry pi hostname.
When the CRON job runs, the program metar.py does not start and the file metarpid.pid is not created and placed in /home/pi as expected.
However, if I type the contents of line 2 in in a terminal window, the metar.py program starts running and metarpid.pid is created in /home/pi as expected.
I do not understand why the crontab command is getting the MTA error which I would think is why metar.py does not start and its pid file not placed in /home/pi.
I am not using email either, which is what I think MTA is referring.

