[SOLVED] How to wake up from suspend mode?

Help with issues regarding installation of Debian

[SOLVED] How to wake up from suspend mode?

Postby littlebigman » 2017-03-27 15:25

Hello

I found I can use the following command to put Debian into suspend mode right away:
Code: Select all
# cat /sys/power/state
freeze standby disk

echo -n standby > /sys/power/state


Once it's in suspend mode, what command should I have Cron run to wake it up at a given time?

Thank you.
Last edited by littlebigman on 2017-03-28 13:40, edited 1 time in total.
littlebigman
 
Posts: 12
Joined: 2008-01-16 21:30

Re: How to wake up from suspend mode?

Postby bw123 » 2017-03-27 16:35

interesting idea! Haven't tried it myself, have you tried any of these?

https://duckduckgo.com/html/?q=automati ... om+suspend
User avatar
bw123
 
Posts: 2378
Joined: 2011-05-09 06:02
Location: TN_USA

Re: How to wake up from suspend mode?

Postby littlebigman » 2017-03-28 13:39

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.
littlebigman
 
Posts: 12
Joined: 2008-01-16 21:30


Return to Installation

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable