I'm using RPI zerow to run a python code (Raspbian Strech-Lite).
I need to run 2 file during startup:
Both files run OK using command line, but when I added 2 job on
crontab only one of them get executed ( the second file ). file name and path are OK.
Searching in all log files in
/var/log did not show aany evidence for failure during boot.
Any idea why ?
@reboot /usr/bin/python3 /home/guy/github/SmartHome_SoC/MQTTswitches/MQTTlogger.py @reboot /usr/bin/python3 /home/guy/github/SmartHome_SoC/MQTTswitches/Sched_MQTT.py
EDIT1: running only
crontab shows that it is a problem with running in
crontab rather than running one after the other.
what can be the reason for file fail to run on a
crontab job, but succeed when executed on a command line ? how can I debug it ?
EDIT2 : trying to catch crontab error
@reboot /usr/bin/python3 /home/guy/github/SmartHome_SoC/MQTTswitches/MQTTlogger.py >> /home/guy/crontab.log 2>&1
File "/home/guy/github/SmartHome_SoC/MQTTswitches/MQTTlogger.py", line 1, in <module> import paho.mqtt.client as mqtt ImportError: No module named 'paho'
so I'm guessing it has something to do with path to the MQTT package