Wednesday, May 1, 2024
 Popular · Latest · Hot · Upcoming
49
rated 0 times [  49] [ 0]  / answers: 1 / hits: 38006  / 2 Years ago, tue, may 17, 2022, 2:52:05

I managed to find out how to suspend/hibernate the system from the command line by reading How can I suspend/hibernate from command line?.



However, I would like to know how to use the command line to suspend/hibernate at a given time, in absolute (example, 11PM) or relative (example, in 30 minutes) terms.



I already know how to do this with shutdown, but I'm note sure if the command is similar.


More From » 11.10

 Answers
1

You can use the at command to schedule any action, including running the commands detailed in that question.



For example, if you want to hibernate in 30 minutes:



echo 'pmi action hibernate' | at now + 30 min



Or if you want to suspend at 11:00 pm:



echo 'pmi action suspend' | at 11pm



If you need to run a command as root, run at with sudo rather than the command itself with sudo (since sudo should only be run interactively, unless you've configured it not to ask for your password). For example, the equivalents of the above commands using pm-hibernate and pm-suspend are:



echo pm-hibernate | sudo at now + 30 min



echo pm-suspend | sudo at 11pm


[#42092] Thursday, May 19, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
anoalk

Total Points: 271
Total Questions: 90
Total Answers: 112

Location: Zambia
Member since Wed, Dec 16, 2020
3 Years ago
anoalk questions
Wed, Mar 15, 23, 04:06, 1 Year ago
Fri, Sep 24, 21, 02:59, 3 Years ago
Sat, Mar 5, 22, 02:33, 2 Years ago
Tue, Mar 22, 22, 07:19, 2 Years ago
;