6

I have to get nine 46" LCD monitors (running Windows) to suspend/sleep at 8pm and wake at 8am every morning. It's been a bit of a mess trying to get the commands working, including the privileges. Since I'm an Ubuntu user first and foremost, I'm wondering how easy this would be in Ubuntu/Linux.

I know cron would be able to run my suspend/sleep command at 8pm (what is the suspend/sleep command anyway?), but what about waking the machine up at 8am without using Wake-on-Lan or manual intervention?

Jorge Castro
  • 73,717
bafromca
  • 581

3 Answers3

4

command to suspend is pm-suspend press pm- and a tab to see other power management commands. I don't think there will be an option to wake the systems by itself as the os itself is not running. You can have one system dedicated to wake the other systems at a particular time. If you don't want to suspend or hibernate but just minimise use of resources, there are ways to spin down hard disk or switch off monitor alone etc. There is a pm-powersave command too.

balki
  • 2,310
1

Just for the monitor? Does this solution from systembash.com work for you? Crate a BASH script to use DPMS feature:

#!/bin/bash
# /usr/local/bin/monitorControl.sh
#
export DISPLAY=:0.0

if [ $# -eq 0 ]; then
    echo usage: $(basename $0) "on|off|status"
    exit 1
fi

if [ $1 = "off" ]; then
    echo -en "Turning monitor off..."
    xset dpms force off
    echo -en "done.\nCheck:"
    xset -q|grep "Monitor is"
elif [ $1 = "on" ]; then
    echo -en "Turning monitor on..."
    xset dpms force on
    echo -en "done.\nCheck:"
    xset -q|grep "Monitor is"
elif [ $1 = "status" ]; then
    xset -q|sed -ne 's/^[ ]*Monitor is //p'
else
    echo usage: $(basename $0) "on|off|status"
fi

And then use cron entires to call it:

0 20 0 0 0 /usr/local/bin/monitorControl.sh off
0  8 0 0 0 /usr/local/bin/monitorControl.sh on

Otherwise, if it's not just the monitor, look at /etc/acpi/sleep.sh and /etc/acpi/hibernate.sh .

0

I don't think there will be an option to wake the systems by itself as the os itself is not running.

As a matter of fact, before you suspend the system, you can set a waking time or timer, using the internal hardware clock of the system, by using the "rtcwake" command: for example, to wake the computer on tomorrow 8:00:

sudo rtcwake -t `date -d "tomorrow 08:00:00" +%s` -m no

then you can use the pm-suspend to suspend the system.

AshkanVZ
  • 126