how to schedule autohibernate and wake up using alarm clock

Asked by gurugdas

auto hibernate command

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu alarm-clock Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
peter (peter-neuweiler) said :
#1

To wake up using an alarm: kalarm (included in Symaptic).
Peter

Revision history for this message
Vihar (vmankov) said :
#2

"auto hibernate command"

gurugdas,
imagine you are asking your friends of this problem...
Do you ask them with three words only?

Revision history for this message
gurugdas (ggd-rns) said :
#3

KALARM IS ONLY FOR KDE DESKTOP . I HAVE GNOME DESKTOP.

SO I HAVE BEEN USING A SOFTWARE CALLED ALARM CLOCK

SUDO PM-HIBERNATE WORKS WITH ANOTHER SOFTWARE 'GNOME SCHEDULE' ..BUT FOR THAT I NEED TO FIRST TYPE SUDO GNOME-SCHEDULE ..PASSWORD AND ADD THE PM..COMMAND
I MEAN THE GNOME SCHEDULE DOES NOT WORK IN THE CHILD (OR USER ACC. WITH ADMIN. PRIVILLAGES)

PREVIOUSLY I GOT THE FOLL. COMMAND ..TO SHUT DOWN PC IN CHILD ACC OR USER ACC( FRANKLY I FEAR IF I DO NOT SERIOUSLY HARM MY UBUNTU WITH THE 'SU...../SHUTDOWN' COMMAND??

su chmod u+s /sbin/shutdown
shutdown -P now( to shut down pc using command)

BUT THE 'shutdown -P now' WORKS ON SCHEDULE FINE

SO IF I COULD GET A SIMILAR COMMAND WITH WHICH TO SCHEDULE A HIBERNATE AND WAKE UP USING ALARM CLOCK SOFTWARE

Revision history for this message
Sam_ (and-sam) said :
#4

Depending on PolicyKit (system administration menu), if suspend or hibernate is allowed for 'active console' this wouldn't need sudo:
gnome-power-cmd suspend ##Suspend_To_RAM (S3)
gnome-power-cmd hibernate ##Suspend_To_Disk (S4)

see also about cron.allow, cron.deny
https://help.ubuntu.com/community/CronHowto
http://docs.sun.com/app/docs/doc/805-7229/6j6q8svfu?a=view

To issue an app which needs GUI:
DISPLAY=:0 name_of_app

Instead of using an alarm app wouldn't it be easier to just play a file within user directory?
e.g.
aplay /home/user/sound/alarm.wav

or use an alarm script as described here ('misc' at the end):
http://linuxcommand.org/script_library.php

Revision history for this message
gurugdas (ggd-rns) said :
#5

rgvani@rgvani:~$ gnome-power-cmd hibernate ##Suspend_To_Disk (S4)
Hibernating
Error org.freedesktop.DBus.Error.Spawn.ChildExited: Launch helper exited with unknown return code 0
Failed
rgvani@rgvani:~$ ....

this is what i got after 'gnome-power-cmd hibernate ##Suspend_To_Disk (S4)'

also i am a novice so cron seems tooo tough for me

Revision history for this message
gurugdas (ggd-rns) said :
#6

besides the' alarm clock' which i mentioned is a separate app. altogether not some alarm shich i am using.

it is a gui for scheduling tasks i have 2 more probs.

1. alarm clock doesn't load up at startup even though i have added it to the start up menu
2. my default desktop theme doesn't load up either..it is just blue dull icons instead of human clearlooks theme

any help is welcome

Revision history for this message
Sam_ (and-sam) said :
#7

This is a command:
gnome-power-cmd hibernate
This is a comment about the command, hence no command.
##Suspend_To_Disk (S4)

Cron is behind Gnome-schedule.
Behind every GUI sits a script which is doing the work.

It was understood that 'alarm clock' is a separate GUI app.
Gnome-schedule needs the mentioned 'Display' command for GUI apps to launch it at time X.

However, you need to find out the correct launch command for 'alarm clock' and make sure file and directory don't need 'root privileges'.
https://help.ubuntu.com/community/FilePermissions

> 2. my default desktop theme doesn't load...
Please launch a new question about this issue, it will help others with the same problem to find an answer, thanks.

Revision history for this message
gurugdas (ggd-rns) said :
#8

i put the command 'gnome-power-cmd hibernate' in terminal and the pc hibernated fine ..but i still got 4 observations ..

1. in terminal i got some error in the terminal
2.my running apps did not load up at wake up
3.it took as much as it takes to boot from shutdown ...
4. it asked me a password at wake up and options like 'unblock ,switch user',etc.
i did not know which to select

.. also if you have a wake up the PC automatically from hibernation (w/o password, w/o pressing any button) at a scheduled time what do i do.....i think something to be done with RTC alarm

Revision history for this message
Sam_ (and-sam) said :
#9

There are several settings which can be reviewed.
system administration -> power management
system preferences -> screensaver

gconf-editor section
apps/gnome-power-manager
has an option "use screensaver settings"
string:
apps/gnome-power-manager/lock/

http://library.gnome.org/users/gconf-editor/2.22/getting-started.html.en

Found this about RTC:
https://help.ubuntu.com/community/MythTV/Install/WhatNext/ACPIWake#ACPI%20RTC%20Wake%20Ability

https://wiki.ubuntu.com/DebuggingGNOMEPowerManager

Behind all this is pm-utils and hal.
https://answers.launchpad.net/ubuntu/+source/acpid/+question/72206

Wiki which is halfway understandable.
http://www.gentoo-wiki.info/Pm-utils

Revision history for this message
gurugdas (ggd-rns) said :
#10

i visited all those pages but sorry i can't make anything useful out of it since i am unable to comprehend all that data

Basically
 1. the hibernate command 'gnome-power-cmd hibernate' is working fine

 i need 2 more things

  1. i have put alarm clock in start up but it does not load up at start up (i checked this in system monitor--processses).. so some help with that please..i mean starting alarm clock at startup

and, 2. i need to wake up pc from hibernate everyday at 4.30 am daily ..how to do that automatically..if possible

Revision history for this message
Sam_ (and-sam) said :
#11

#1
Hibernate saves running apps to disk as image, if swap is big enough.
Swap = RAM + 30%
https://wiki.ubuntu.com/KernelTeam/Specs/JauntySuspendResumeHibernate

Is option save gnome-session enabled?
(Not sure if it helps, don't use it since here all apps resume.)
In case see also
~/.config/autostart
~/.profile

#2
as mentioned above about RTC, needs BIOS interaction.
http://ubuntuforums.org/showthread.php?s=467a60a1a45778c750b855c104cdc3cd&t=313884&page=2
http://brainstorm.ubuntu.com/idea/2923/

alternative cron howto
http://members.iinet.net.au/~herman546/p8.html#alarm_clock

Revision history for this message
gurugdas (ggd-rns) said :
#12

rgvani@rgvani:~$ ~/.config/autostart
bash: /home/rgvani/.config/autostart: is a directory
rgvani@rgvani:~$ ~/.profile
bash: /home/rgvani/.profile: Permission denied
rgvani@rgvani:~$

Revision history for this message
gurugdas (ggd-rns) said :
#13

what next ?

Revision history for this message
gurugdas (ggd-rns) said :
#14

rt.now i am going out of station so i may not be able to contact you for
about 15-20 days or even read any mails so pl. bear with me

GGD

On Tue, Sep 1, 2009 at 2:48 AM, Sam <email address hidden>wrote:

> Your question #81203 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/81203
>
> Status: Open => Answered
>
> Sam proposed the following answer:
> #1
> Hibernate saves running apps to disk as image, if swap is big enough.
> Swap = RAM + 30%
> https://wiki.ubuntu.com/KernelTeam/Specs/JauntySuspendResumeHibernate
>
> Is option save gnome-session enabled?
> (Not sure if it helps, don't use it since here all apps resume.)
> In case see also
> ~/.config/autostart
> ~/.profile
>
>
> #2
> as mentioned above about RTC, needs BIOS interaction.
>
> http://ubuntuforums.org/showthread.php?s=467a60a1a45778c750b855c104cdc3cd&t=313884&page=2
> http://brainstorm.ubuntu.com/idea/2923/
>
> alternative cron howto
> http://members.iinet.net.au/~herman546/p8.html#alarm_clock<http://members.iinet.net.au/%7Eherman546/p8.html#alarm_clock>
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/ubuntu/+question/81203/+confirm?answer_id=10
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+question/81203
>
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
Sam_ (and-sam) said :
#15

No problem, just reopen the question.

Is there any content?
~/.config/gnome-session/saved-session/
http://library.gnome.org/users/user-guide/stable/sessions.html.en

This is a path which can be viewed e.g. via Nautilus (file manager), this ~ is symbolic for /home/ directory.
~/.config/autostart
##Other term:
/home/user/.config/autostart

The dot stands for hidden file, to view hidden files press ctrl+H while in Nautilus.
http://library.gnome.org/users/user-guide/stable/nautilus-presentation.html.en

This is a file which may content commands for autostart
~/.profile
You may right click the file to check permissions.
##Files in /home/user/ directory shouldn't need 'root' privileges (means access via 'sudo' cmd)
https://help.ubuntu.com/community/FilePermissions

However, I guess it makes sense to decide whether to run the app 'alarm clock' as cron job
(e.g. via gnome-schedule) or as autostart or as saved app via gnome-session.

About CLI
https://help.ubuntu.com/9.04/basic-commands/C/

Revision history for this message
gurugdas (ggd-rns) said :
#16

I think i wish to start alarm clock application every day at 4 pm
so how do i decide whether to run the app 'alarm clock' as cron job
(e.g. via gnome-schedule) or as autostart or as saved app via gnome-session ?

Revision history for this message
gurugdas (ggd-rns) said :
#17

kindly guide me to start alarm clock at pc boot up. I have already put it in
the startup apps.

On Wed, Sep 2, 2009 at 11:35 PM, Sam <email address hidden>wrote:

> Your question #81203 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/81203
>
> Status: Open => Answered
>
> Sam proposed the following answer:
> No problem, just reopen the question.
>
> Is there any content?
> ~/.config/gnome-session/saved-session/
> http://library.gnome.org/users/user-guide/stable/sessions.html.en
>
> This is a path which can be viewed e.g. via Nautilus (file manager), this ~
> is symbolic for /home/ directory.
> ~/.config/autostart
> ##Other term:
> /home/user/.config/autostart
>
> The dot stands for hidden file, to view hidden files press ctrl+H while in
> Nautilus.
>
> http://library.gnome.org/users/user-guide/stable/nautilus-presentation.html.en
>
> This is a file which may content commands for autostart
> ~/.profile
> You may right click the file to check permissions.
> ##Files in /home/user/ directory shouldn't need 'root' privileges (means
> access via 'sudo' cmd)
> https://help.ubuntu.com/community/FilePermissions
>
> However, I guess it makes sense to decide whether to run the app 'alarm
> clock' as cron job
> (e.g. via gnome-schedule) or as autostart or as saved app via
> gnome-session.
>
> About CLI
> https://help.ubuntu.com/9.04/basic-commands/C/
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/ubuntu/+question/81203/+confirm?answer_id=14
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+question/81203
>
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
Sam_ (and-sam) said :
#18

Welcome back.

> i wish to start alarm clock application every day at 4 pm

In this case autostart wouldn't make sense, because it will start after login.

If you like it to start at time xxxx then add 'alarm clock' (as described on 2009-08-30/29) into gnome-schedule (self explaining GUI, human readable, installable via Synaptic)
http://packages.ubuntu.com/jaunty/gnome-schedule
http://gnome-schedule.sourceforge.net/

The result would be that gnome-schedule would start at time xxxx 'alarm clock' and again 'alarm clock' sets up a scheduled alarm.
btw. 'alarm clock' will get an applet in Karmic.
http://packages.ubuntu.com/search?suite=default&section=all&arch=any&searchon=names&keywords=alarm+clock

> start alarm clock at pc boot up

system preferences -> sessions
http://library.gnome.org/users/user-guide/stable/sessions.html.en

system preferences -> sessions -> tab startup programs
http://library.gnome.org/users/user-guide/stable/gosstartsession-2.html.en

Again, try it with the full path if it doesn't work with 'alarm clock' only.

Revision history for this message
gurugdas (ggd-rns) said :
#19

i need the exact command to be put in the gnome schedule .The name of the
app is alarm clock . i read the aug 30 mail and tried to do the gnome
schedule but somehow couldnt get it working .I do not know whether to select
4 pm or 16.00 etc . thanks in advance.

On Thu, Sep 17, 2009 at 1:34 AM, Sam <email address hidden>wrote:

> Your question #81203 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/81203
>
> Status: Open => Answered
>
> Sam proposed the following answer:
> Welcome back.
>
> > i wish to start alarm clock application every day at 4 pm
>
> In this case autostart wouldn't make sense, because it will start after
> login.
>
> If you like it to start at time xxxx then add 'alarm clock' (as described
> on 2009-08-30/29) into gnome-schedule (self explaining GUI, human readable,
> installable via Synaptic)
> http://packages.ubuntu.com/jaunty/gnome-schedule
> http://gnome-schedule.sourceforge.net/
>
> The result would be that gnome-schedule would start at time xxxx 'alarm
> clock' and again 'alarm clock' sets up a scheduled alarm.
> btw. 'alarm clock' will get an applet in Karmic.
>
> http://packages.ubuntu.com/search?suite=default&section=all&arch=any&searchon=names&keywords=alarm+clock
>
> > start alarm clock at pc boot up
>
> system preferences -> sessions
> http://library.gnome.org/users/user-guide/stable/sessions.html.en
>
> system preferences -> sessions -> tab startup programs
> http://library.gnome.org/users/user-guide/stable/gosstartsession-2.html.en
>
> Again, try it with the full path if it doesn't work with 'alarm clock'
> only.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/ubuntu/+question/81203/+confirm?answer_id=17
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+question/81203
>
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
gurugdas (ggd-rns) said :
#20

also i do have an alarm clock application already installed but i just need
it to start up at 4 pm or at start up --whichever is simpler--i have tried
putting it in the' start up apps'
which is similar to' system preferences+gnome sesions 'on my pc ..but
doesn't work
On Thu, Sep 17, 2009 at 4:39 AM, gurugdas <
<email address hidden>> wrote:

> Your question #81203 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/81203
>
> Status: Answered => Open
>
> You are still having a problem:
> i need the exact command to be put in the gnome schedule .The name of the
> app is alarm clock . i read the aug 30 mail and tried to do the gnome
> schedule but somehow couldnt get it working .I do not know whether to
> select
> 4 pm or 16.00 etc . thanks in advance.
>
> On Thu, Sep 17, 2009 at 1:34 AM, Sam
> <email address hidden>wrote:
>
> > Your question #81203 on Ubuntu changed:
> > https://answers.launchpad.net/ubuntu/+question/81203
> >
> > Status: Open => Answered
> >
> > Sam proposed the following answer:
> > Welcome back.
> >
> > > i wish to start alarm clock application every day at 4 pm
> >
> > In this case autostart wouldn't make sense, because it will start after
> > login.
> >
> > If you like it to start at time xxxx then add 'alarm clock' (as described
> > on 2009-08-30/29) into gnome-schedule (self explaining GUI, human
> readable,
> > installable via Synaptic)
> > http://packages.ubuntu.com/jaunty/gnome-schedule
> > http://gnome-schedule.sourceforge.net/
> >
> > The result would be that gnome-schedule would start at time xxxx 'alarm
> > clock' and again 'alarm clock' sets up a scheduled alarm.
> > btw. 'alarm clock' will get an applet in Karmic.
> >
> >
> http://packages.ubuntu.com/search?suite=default&section=all&arch=any&searchon=names&keywords=alarm+clock
> >
> > > start alarm clock at pc boot up
> >
> > system preferences -> sessions
> > http://library.gnome.org/users/user-guide/stable/sessions.html.en
> >
> > system preferences -> sessions -> tab startup programs
> >
> http://library.gnome.org/users/user-guide/stable/gosstartsession-2.html.en
> >
> > Again, try it with the full path if it doesn't work with 'alarm clock'
> > only.
> >
> > --
> > If this answers your question, please go to the following page to let us
> > know that it is solved:
> >
> https://answers.launchpad.net/ubuntu/+question/81203/+confirm?answer_id=17
> >
> > If you still need help, you can reply to this email or go to the
> > following page to enter your feedback:
> > https://answers.launchpad.net/ubuntu/+question/81203
> >
> > You received this question notification because you are a direct
> > subscriber of the question.
> >
>
> --
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
gurugdas (ggd-rns) said :
#21

 i just got one success which i wish to share:
1. i entered the full path as you mentioned (/usr/local/bin/alarm clock) in the startup menu and it is working when i boot up the pc.

  but i still need a small help:

   How do i terminate some application with alarm clock (i.e. auto ending a running program at a specified schedule) ... i need a command to be put in the alarm clock.... if possible

Revision history for this message
gurugdas (ggd-rns) said :
#22

also is it possible to schedule a fzilla file transfer using alarm clock

Revision history for this message
Sam_ (and-sam) said :
#23

Seems alarm clock doesn't include this feature.
https://launchpad.net/alarm-clock
Options to schedule jobs are e.g. cron, gnome-schedule, scripts.

Whatever you'd like to achieve it's possible to test commands in a terminal and if it meets your needs use it in an app of your choice.

Can you help with this problem?

Provide an answer of your own, or ask gurugdas for more information if necessary.

To post a message you must log in.