Saturday 2 December 2017

root crontab doesn't work on raspberry PI Zero

Due to the hardware bug where the network loses connection on the PI Zero it is necessary to either restart the network or the Pi.

I thought I had done this by logging in as root, running crontab -e and then adding a script to reboot the Pi. However I noticed it wasn't working.

In the end I found out it was reporting "Command not found" on shutdown.

Crontab clears out the $PATH variable when running.

The solution was to command an explicit shutdown:

/sbin/shutdown -r

No comments:

Post a Comment