Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[SOLVED] How to wake up from suspend mode?

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
littlebigman
Posts: 23
Joined: 2008-01-16 21:30

[SOLVED] How to wake up from suspend mode?

#1 Post by littlebigman »

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.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: How to wake up from suspend mode?

#2 Post by bw123 »

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

https://duckduckgo.com/html/?q=automati ... om+suspend
resigned by AI ChatGPT

littlebigman
Posts: 23
Joined: 2008-01-16 21:30

Re: How to wake up from suspend mode?

#3 Post by littlebigman »

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.

Post Reply