I want my headless Raspberry Pi to reboot every night. I have the latest firmware (sudo rpi-update
) and Raspbian is up to date (sudo apt-get update && sudo apt-get upgrade
). For the cronjob I did
sudo crontab -e
and added the only line
0 3 * * * /sbin/shutdown -r now
At the given time the Raspberry Pi actually shuts down but does not boot up again. All LEDs go off (except the PWR one, since it still is connected to the power outlet). It's like one does -h
instead of -r
. I also tried with reboot
, same problem.
Invoking
sudo shutdown -r now
or
sudo reboot
on a regular SSH command line while logged in as user pi
does a clean reboot with full booting, just as it should be.
How can I cleanly reboot my Raspberry Pi with a cronjob?
Additional notes: Putting reboot
or shutdown -r now
in a bash script and run this as a cronjob instead of calling the commands directly, everything works fine.
sudo crontab -e
is the root crontab, then yes, see question. – Foo Bar May 27 '14 at 8:54