Automation/RaspberryPi: Difference between revisions

From Medien Wiki
Line 133: Line 133:


Note that the Raspberry is searching online for the current time when booting. If there is no Internet the time might not be accurate.
Note that the Raspberry is searching online for the current time when booting. If there is no Internet the time might not be accurate.
====Shut down at specific time===
The shutdown command has a timer built in, so when it is called like this
sudo shutdown -h 15:00
the system will shut down at three in the after noon.
sudo shutdown -h +30
will shut the system down in 30 minutes from now.
You can also set a cron job for shutting down on specific days at specific times.
sudo crontab -e
add this line:
45 18 * * * /sbin/shutdown -h now
to shut down 45mins past 6PM
[https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=59520 source]


[[Category:Automation]]
[[Category:Automation]]
[[Category:RaspberryPi]]
[[Category:RaspberryPi]]