Hi,
I'm trying to power down a Pi that is running a display screen for my Home Assistant when no one is there.
I started to learn to setup automated shutdown and wake up using RTC - https://www.linux.com/training-tutorial ... arm-clock/
So first I made a script in /usr/local/bin/shutwake.sh that contains:
Followed by creating a cron task:
and adding at the end:
However it doesn't seem to work. Can someone help me figure out how to either get an error code (there doesn't seem to be anything in Bookworm that puts cron errors in 'mail') or point out what error/assumption I'm making?
I'm trying to power down a Pi that is running a display screen for my Home Assistant when no one is there.
I started to learn to setup automated shutdown and wake up using RTC - https://www.linux.com/training-tutorial ... arm-clock/
So first I made a script in /usr/local/bin/shutwake.sh that contains:
Code:
#!/bin/bash#define PATH and SHELL due to calling from root crontabPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin#clear any wakealarmssh -c "/usr/bin/echo 0 > /sys/class/rtc/rtc0/wakealarm"#set boot to tomorrows 0655sh -c "/usr/bin/echo `/bin/date '+%s' -d '0655 tomorrow'` > /sys/class/rtc/rtc0>#shutdown at current timeshutdown -h now
Code:
sudo crontab -e
Code:
# run script that shuts down Pi at 2200 every night and boots it at 065505 22 * * * /usr/local/sbin/shutwake.sh
Statistics: Posted by Baenwort — Thu Dec 28, 2023 3:19 pm