Ask Your Question

schedule a suspend with systemctl from command line

asked 2015-10-16 10:30:42 -0500

fedelibre gravatar image

Sometimes I want to schedule a suspend to happen at a certain time and I'd like to do it using the command line. I thought that using at might work, but nothing happens:

$ echo 'systemctl suspend' | at now + 1 min
warning: commands will be executed using /bin/sh
job 3 at Fri Oct 16 17:16:00 2015

systemctl suspend alone works fine and does not require root privilege. I guess that /bin/sh does not play well with systemd? What would you recommend? pm-utils is not in Fedora anymore, as far as I can understand.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-10-17 03:33:22 -0500

vtrefny gravatar image

There might be better solution but this one seems to be working just fine:

sleep 1m && systemctl suspend
edit flag offensive delete link more


thank you, it works fine I cannot upvote, not enough points yet..

fedelibre gravatar imagefedelibre ( 2015-10-20 07:44:05 -0500 )edit

sleep 1m && systemctl suspend -i

sisman gravatar imagesisman ( 2017-03-03 23:10:26 -0500 )edit

Question Tools

1 follower


Asked: 2015-10-16 10:30:42 -0500

Seen: 1,888 times

Last updated: Oct 17 '15