From what I read, most *nix hosts come with a utility called "rtcwake" ("real-time clock").
To check if the BIOS set the time in UTC or local time: timedatectl
To check what suspend modes your hardware supports: cat /sys/power/state
Here's how to tell rtcwake to 1) not suspend now (-m no), tell it that the BIOS is set to UTC time (-u), and 3) wake up tomorrow at 11:45AM:
Code: Select all
rtcwake -m no -u -t $(date +%s -d 'tomorrow 11:45')
Note that rtcwake displays the wakeup time in UTC, not local time.
And here's how to put it to standby immediately:
Code: Select all
echo -n standby > /sys/power/state
For testing purposes, here's how to tell rtcwake to go into suspend mode in 1mn, and suspend:
Code: Select all
rtcwake -m no -u -t $(date +%s -d '1 minute')
echo -n standby > /sys/power/state
To cancel, use "rtcwake -m disable".
AFAICT, rtcwake can only take one job at a time: If you want the computer to go
back to sleep, such as after backing up files, use cron to add a similar call to rtcwake using the "-m" switch.
I didn't find how to check if rtcwake is running, and checking what job it's scheduled to run.
One good article to get started:
https://www.howtogeek.com/121241/how-to ... matically/
Alternatively, you can use the pm-utils package, and add a cron job.