Results 1 to 8 of 8

Thread: scheduling

  1. #1
    Join Date
    May 2011
    Location
    here
    Posts
    180

    Default scheduling

    HI all,
    thought will make a use of "at" command but cant get it working
    Code:
    andre@linux-jxv5:~> at now +2 min 
    warning: commands will be executed using /bin/sh
    at> amarok
    at> <EOT>
    job 10 at 2011-09-12 20:29
    with deamon running:
    Code:
    job 10 at 2011-09-12 20:29
    andre@linux-jxv5:~> /etc/init.d/atd start
    Starting service at daemon                                              done
    but nothing happens....

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,290

    Default Re: scheduling

    How did you find out it is not working?
    Why do you not test such a feature with something simple like:
    Code:
    echo "It is now $(date)" > /tmp/at-test
    as something to run in the batch? Then you can easily check the existanece and contents of /tmp/at-test.

    What do you think that would happen when you do that amarok call in the batch?
    Do you know where to look where the loging of the errors of that amarok statement went into? And did you look there?
    Henk van Velden

  3. #3
    Join Date
    May 2011
    Location
    here
    Posts
    180

    Default Re: scheduling

    hi hcvv, good questions, I thought when I used "at" amarok, amarok will play, and no I havent check the logging errors.

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,290

    Default Re: scheduling

    I guess you do not realize that cron/at/batch run commands in the batch or background. There is no display connected which such a command. And amarok, being a GUI program, does not know where to display it's window.

    You forgot that Unix/Linux is a multi user OS and that many users (or even none) can be loged in (in the CLI or in the GUI) at the moment that the batch run starts. So where should the amarok window show?

    Added to this, you probably forgot that X is a network server application (one talks about the X server). And those those available displays of those loged in users can be on other systems throughout the internet. Which of them should amarok use?

    Also amarok most probably wants to use a sound device. But the sound device is probably allready in us by a session that runs a GUI in the foreground. Not all sessions (GUI, CLI or batch) may use the sound device at the same time. Would create a sound mess, I guess. But I am not sure about how this works in reality.

    I hope you get the message that doing things like this ask for some contemplating before trying


    That said, when you realy want this, there are a few pathes to try.
    1) Tell amarok which display to use. You can see the display you are using during your GUI session with
    Code:
    henk@boven:~> echo $DISPLAY
    :0
    henk@boven:~>
    which is normal when you have only one user loged in in the GUI. Thus you could try
    Code:
    DISPLAY=:0 amarok
    for your batch run.
    2) But there is also security. It would be a big security hole if everybody could open windows on your session at will. So you have to allow that from your GUI session. In a terminal do
    Code:
    xhost +
    before the batch run starts (or even before you use at).
    Now the xhost + opens for all and everyting. Thus when, after testing what you want works, do
    Code:
     man xhost
    to find a more secure form like only allowing from your local host.
    Henk van Velden

  5. #5

    Default Re: scheduling

    In case you don't want complications, but just want to do the job, use "KAlarm" application to shedule X apps.

  6. #6
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: scheduling

    On 2011-09-13 11:16, Barafu wrote:
    >
    > In case you don't want complications, but just want to do the job, use
    > "KAlarm" application to shedule X apps.


    That is after you define "the job" in a certain way >:-)

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  7. #7
    Join Date
    May 2011
    Location
    here
    Posts
    180

    Default Re: scheduling

    hi hcvv and thanks for System Administrator answer, to be honest I just found that "at" command and didnt think about where it would run... any way thanks for answer

    what would you suggest for scheduling thinks like amarok, evolution etc....

    thanks...

  8. #8
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: scheduling

    On 2011-09-15 14:26, loand wrote:
    > what would you suggest for scheduling thinks like amarok, evolution
    > etc....


    Try Barafu suggestion.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •