V
V
vldanch2019-11-15 09:55:35
JavaScript
vldanch, 2019-11-15 09:55:35

How to put a computer into sleep mode and wake it up at a specific time?

Good afternoon, please tell me how to put the computer into sleep mode and wake it up at a certain time?
I found this article:
https://cmcenroe.me/2014/11/24/scheduled-suspend-a...
It says that you need to create a timer:

nano /etc/systemd/system/auto-suspend.timer

[Unit]
Description=Automatically suspend on a schedule

[Timer]
OnCalendar=*-*-* 03:00:00

[Install]
WantedBy=timers.target

Then service:
nano /etc/systemd/system/auto-suspend.service

[Unit]
Description=Suspend

[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl suspend

Next, wake up on a timer:
nano /etc/systemd/system/auto-resume.timer

[Unit]
Description=Automatically resume on a schedule

[Timer]
OnCalendar=*-*-* 18:30:00
WakeSystem=true

[Install]
WantedBy=timers.target

And the awakening itself:
nano /etc/systemd/system/auto-resume.service
[Unit]
Description=Does nothing

[Service]
Type=oneshot
ExecStart=/bin/true

Yes, such a design works, but the computer is put into standby mode and spins coolers, but how to make it so that it turns off the power, writes the state to disk or memory, and then wakes up at certain hours?
If you specify ExecStart=/usr/bin/systemctl hibernate, then it will turn off, but resume will not do it, how to make it exit hibernate mode or, say, poweroff mode?

Answer the question

In order to leave comments, you need to log in

8 answer(s)
A
Alexander Sharomet, 2018-11-01
@1Sergey1

You can connect JqueryUI and adjust the styles yourself.

F
Flying, 2018-11-01
@Flying

Take a look at noUiSlider , it is (as the name suggests) quite customizable, rich in features and has no unnecessary dependencies.

B
Barmunk, 2018-11-08
@Barmunk

monster Ion.RangeSlider can do everything and even more

W
Wexter, 2019-11-15
@Wexter

Your computer is turned off, how do you want the OS to turn it on?
Look in the BIOS settings, in some there is a scheduled inclusion

D
Dmitry, 2019-11-15
@Tabletko

you can also wake up the computer via wake on lan

V
Vladimir Korotenko, 2019-11-15
@firedragon

There is a Wakeup calendar in BIOS.
Customize it.
In the case of my motherboard, there is an opportunity to program all week.

F
fara_ib, 2019-11-15
@fara_ib

This is how I do it in the cron: 0 0 * * * rtcwake -m off -s 43200 that is, it goes to sleep at midnight and wakes up 12 hours later. Coolers don't spin. Loading is normal. You also need to enable wake on in the bios.

S
Sergey Mironov, 2019-11-17
@MozgFx

There is a sleep mode and there is a standby mode.
You have described the differences.
Wakeon Lan - for remote wakeup
It must also be enabled in both BIOS and OS.
More:
UEFi BIOS there is such an item "Enable via RTC" it can be what you need.
Power-On by Alarm - available on older devices.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question