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 08:54sudo reboot
in a script file and call the script file frompi
's crontab. Now the reboot works fine. It seems only not to work when callingreboot
orshutdown
directly as a cronjob. – Foo Bar May 27 '14 at 09:59Redis
installation scripts messed up the system -- you should read more carefully and don't put totally unrelated links in your question. – lenik May 27 '14 at 11:43Redis
, but that it is not working for me could mean that there are other packages that screw something up as well - so I showed the link, maybe it's useful for someone to have food for thought. – Foo Bar May 27 '14 at 12:15