LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-04-2010, 04:42 PM   #1
Geert86
Member
 
Registered: Jul 2008
Posts: 46

Rep: Reputation: 15
Howto put linux in sleep mode at 1 am and wake up at 6 am automatically


Well, my question is pretty simple, the answer is not I think.

Is it possible to let a Linux PC put itself into sleep mode at 1 am, and wake up, by itself at 6 am?

Best regards,

Geert
 
Old 01-04-2010, 04:59 PM   #2
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
You can set the machine to sleep at a particular time, but it needs an external event to wake it.
 
Old 01-04-2010, 05:26 PM   #3
vendtagain
Member
 
Registered: Sep 2009
Distribution: Slackware, Debian, Mac OS X, Zenwalk, Puppy, Gentoo
Posts: 199

Rep: Reputation: 32
use the command "at" to schedule time to sleep

at 0100
>pm-suspend
<ctrl-D>

as for waking up:
tie a weight on a string above the power button
position strong magnifying glass to focus the morning sun's energy onto the string

Last edited by vendtagain; 01-04-2010 at 05:28 PM.
 
Old 01-04-2010, 08:01 PM   #4
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
lol

usually when I see a request like this it is because of some Windows program which claims to perform the task.
 
Old 01-04-2010, 09:42 PM   #5
rich_c
Member
 
Registered: Apr 2008
Location: UK
Distribution: Mepis; Maemo; openSUSE
Posts: 384
Blog Entries: 74

Rep: Reputation: 81
I've got a Dell Optiplex 740. I suspend it to disk as & when I'm finished with it for the day & a bios setting powers it up at 0600.
 
Old 01-05-2010, 04:47 AM   #6
Geert86
Member
 
Registered: Jul 2008
Posts: 46

Original Poster
Rep: Reputation: 15
Thanks for the help. My Bios does support Wake On Timer, so am gonna try that combined with sleep in cron file

What is the sleep command. pm-suspend does not work (it gives no error, but also no action, did it as root user)

Best regards,

Geert

[PS. it is to save power during the night automatically, because the server is only used for file sharing and showing pictures in our hal)

Last edited by Geert86; 01-05-2010 at 05:53 AM.
 
Old 01-05-2010, 06:41 AM   #7
Geert86
Member
 
Registered: Jul 2008
Posts: 46

Original Poster
Rep: Reputation: 15
I now put PM_DEBUG = true pm-suspend, and it ouputs now:

Code:
++ '[' -f /etc/pm/config.d/pm.conf ']'
++ '[' '' ']'
++ '[' '' ']'
++ '[' '' ']'
++ '[' '' ']'
++ set -a
++ . /etc/pm/config.d/pm.conf
+++ SLEEP_MODULE=kernel
+++ PM_DEBUG=true
+++ pm-suspend
++ set -a
++ PM_UTILS_LIBDIR=/usr/lib/pm-utils
++ PM_UTILS_ETCDIR=/etc/pm
++ PM_UTILS_RUNDIR=/var/run/pm-utils
++ PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/lib/pm-utils/bin
++ INHIBIT=/var/run/pm-utils/inhibit
++ PM_LOGFILE=/var/log/pm-suspend.log
++ TEMPORARY_CPUFREQ_GOVERNOR=performance
++ LOCKDIR=/var/run/pm-utils/locks
++ STORAGEDIR=/var/run/pm-utils/storage
++ NA=254
++ NX=253
++ DX=252
++ PM_FUNCTIONS=/usr/lib/pm-utils/functions
++ LC_COLLATE=C
++ HIBERNATE_MODE=
++ HIBERNATE_RESUME_POST_VIDEO=no
++ SLEEP_MODULE=auto
++ SUSPEND_MODULES=
++ HOOK_BLACKLIST=
++ ADD_PARAMETERS=
++ DROP_PARAMETERS=
++ PARAMETERS=/var/run/pm-utils/storage/parameters
++ PM_CMDLINE=
++ '[' -f /usr/lib/pm-utils/defaults ']'
++ . /usr/lib/pm-utils/defaults
++ set +a
++ for cfg in '"${PM_UTILS_ETCDIR}"/config.d/*[!~]'
This seems to repeat forever, so I closed the process.

I have no idea what can be wrong...
 
Old 01-05-2010, 03:35 PM   #8
rich_c
Member
 
Registered: Apr 2008
Location: UK
Distribution: Mepis; Maemo; openSUSE
Posts: 384
Blog Entries: 74

Rep: Reputation: 81
The thought of automating the suspend never crossed my mind. As I mentioned, I just suspend it manually when the family are finished with it for the night.
 
Old 01-06-2010, 01:47 AM   #9
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
man rtcwake
This program is used to enter a system sleep state until specified
wakeup time.

This uses cross-platform Linux interfaces to enter a system sleep
state, and leave it no later than a specified time. It uses any RTC
framework driver that supports standard driver model wakeup flags.

This is normally used like the old apmsleep utility, to wake from a
suspend state like ACPI S1 (standby) or S3 (suspend-to-RAM). Most
platforms can implement those without analogues of BIOS, APM, or ACPI.

On some systems, this can also be used like nvram-wakeup, waking from
states like ACPI S4 (suspend to disk). Not all systems have persistent
media that are appropriate for such suspend modes.


In Ubuntu 9.10
 
1 members found this post helpful.
Old 01-06-2010, 02:06 AM   #10
vendtagain
Member
 
Registered: Sep 2009
Distribution: Slackware, Debian, Mac OS X, Zenwalk, Puppy, Gentoo
Posts: 199

Rep: Reputation: 32
Quote:
What is the sleep command. pm-suspend does not work (it gives no error, but also no action, did it as root user)
pm-suspend is part of "pm-utils", and you may need to configure it first.

Look in /etc/pm/
man page gives some info about these files.

pm-suspend
# sleep to ram
pm-hibernate
# suspends to hard-disk

suspend wake up quicker
hibernate will save more power
 
Old 01-06-2010, 08:09 AM   #11
Geert86
Member
 
Registered: Jul 2008
Posts: 46

Original Poster
Rep: Reputation: 15
I have 3 folders in /etc/pmp/:

config.d/
power.d/
sleep.d/

They are all empty. So what to do know?

Best regards, Geert
 
Old 01-06-2010, 11:36 AM   #12
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
what is wrong with rtcwake?
what is your distro?

do you have acpi enabled? (you can sleep etc right?)
 
Old 01-07-2010, 05:17 AM   #13
Geert86
Member
 
Registered: Jul 2008
Posts: 46

Original Poster
Rep: Reputation: 15
Through BIOS I have ACPI enabled. I can choose for the suspend mode between:
- suspend to disk
- power on suspend (or something like that)
So it seems my bios does not suspend to ram


I have never succeeded to put my computer into sleep mode, or hibernate mode

My distro: Debian Lenny

When using rtcwake:
razer:/home/hurman# rtcwake -s 3700
rtcwake: wakeup from "suspend" using /dev/rtc0 at Thu Jan 7 11:15:58 2010

And than it does nothing... strangely enough the rtc wake time seems to be in GMT time, while, I am in +1 Amsterdam time. But it does nothing when I do this command.

The same for
pm-is-supported --suspend
It does absolutely nothing

Hibernate is available from the menu, but everytime I do it, it fails... (so it hibernates, but when I want to turn it on again, the first time I press the power button it does load, but not fully. The second time i do a hard reset and it works.

So any ideas ?
 
Old 01-07-2010, 08:24 AM   #14
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
Quote:
rtcwake: wakeup from "suspend" using /dev/rtc0
Interesting

also see
http://ubuntuforums.org/showthread.php?t=938533

acpi handles sleep etc.

dmesg | grep -i acpi

debian lenny? - and machine?
note: http://wiki.debian.org/Suspend
Quote:
Because software suspend is still experimental, it is not enabled by default on most machines. Depending on your system, a few more steps are needed to get suspend partially or fully working.

Last edited by Simon Bridge; 01-07-2010 at 08:26 AM.
 
Old 01-08-2010, 04:57 AM   #15
Geert86
Member
 
Registered: Jul 2008
Posts: 46

Original Poster
Rep: Reputation: 15
Hi,

I have a:
Code:
Processor		: Pentium III (Katmai) (500 MHz)
Memory		        : 256MB (140MB used)
Operating System	: Debian GNU/Linux 5.0.3
And when I do the following ocmmand I get: dmesg | grep -i acpi
Code:
razer:/home/hurman# dmesg | grep -i acpi
[    0.000000]  BIOS-e820: 000000000fff0000 - 000000000fff3000 (ACPI NVS)
[    0.000000]  BIOS-e820: 000000000fff3000 - 0000000010000000 (ACPI data)
[    0.000000] ACPI: RSDP 000F6DF0, 0014 (r0 AWARD )
[    0.000000] ACPI: RSDT 0FFF3000, 0028 (r1 AWARD  AWRDACPI 42302E31 AWRD        0)
[    0.000000] ACPI: FACP 0FFF3040, 0074 (r1 AWARD  AWRDACPI 42302E31 AWRD        0)
[    0.000000] ACPI: DSDT 0FFF30C0, 1F28 (r1 AWARD  AWRDACPI     1000 MSFT  100000A)
[    0.000000] ACPI: FACS 0FFF0000, 0040
[    0.000000] ACPI: PM-Timer IO Port: 0x4008
[    0.117833] ACPI: Core revision 20080321
[    0.125111] ACPI: setting ELCR to 0200 (from 1c20)
[    0.130217] ACPI: bus type pci registered
[    0.172981] ACPI: EC: Look up EC in DSDT
[    0.181369] ACPI: Interpreter enabled
[    0.181382] ACPI: (supports S0 S1 S4 S5)
[    0.181450] ACPI: Using PIC for interrupt routing
[    0.194867] ACPI: PCI Root Bridge [PCI0] (0000:00)
[    0.195536] pci 0000:00:07.3: quirk: region 4000-403f claimed by PIIX4 ACPI
[    0.195933] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
[    0.224941] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 10 *11 12 14 15)
[    0.225830] ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 10 11 *12 14 15)
[    0.226633] ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 *5 6 7 10 11 12 14 15)
[    0.227405] ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 7 *10 11 12 14 15)
[    0.228475] pnp: PnP ACPI init
[    0.228509] ACPI: bus type pnp registered
[    0.239408] pnp: PnP ACPI: found 12 devices
[    0.239422] ACPI: ACPI bus type pnp unregistered
[    0.239438] PnPBIOS: Disabled by ACPI PNP
[    0.241177] PCI: Using ACPI for IRQ routing
[    0.241816] ACPI: RTC can wake from S4
[    4.051352] ACPI: CPU0 (power states: C1[C1] C2[C2])
[    4.051615] ACPI: ACPI0007:00 is registered as cooling_device0
[    4.051635] ACPI: Processor [CPU0] (supports 8 throttling states)
[    6.499391] ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 12
[    6.499418] ACPI: PCI Interrupt 0000:00:0b.0[A] -> Link [LNKB] -> GSI 12 (level, low) -> IRQ 12
[    8.212500] ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 10
[    8.212530] ACPI: PCI Interrupt 0000:00:07.2[D] -> Link [LNKD] -> GSI 10 (level, low) -> IRQ 10
[   22.546315] parport_pc 00:0a: reported by Plug and Play ACPI
[   22.624373] ACPI: Power Button (FF) [PWRF]
[   22.654101] ACPI: Power Button (CM) [PWRB]
[   26.218308] ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 5
[   26.218337] ACPI: PCI Interrupt 0000:00:0a.0[A] -> Link [LNKC] -> GSI 5 (level, low) -> IRQ 5
[   59.766761] ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 11
[   59.766805] ACPI: PCI Interrupt 0000:01:00.0[A] -> Link [LNKA] -> GSI 11 (level, low) -> IRQ 11
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
System goes into sleep mode, can't wake it up. Have to reboot. BHT Linux - Newbie 2 12-16-2008 07:16 AM
Is it better to let computer power off and on later or put it to sleep mode ? pleasehelpme Linux - Newbie 1 12-10-2007 06:38 PM
how can I put the CPU in sleep mode? asahlot Linux - Software 2 11-03-2006 11:23 AM
Mouse wont wake after sleep mode icedfusion Ubuntu 3 09-11-2006 10:23 PM
monitor in supsend/sleep mode... can't "wake" it up schbond Linux - Hardware 2 09-15-2003 01:03 AM


All times are GMT -5. The time now is 02:04 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration