scheduling

HI all,
thought will make a use of “at” command but cant get it working

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:

job 10 at 2011-09-12 20:29
andre@linux-jxv5:~> /etc/init.d/atd start
Starting service at daemon                                              done

but nothing happens…

How did you find out it is not working?
Why do you not test such a feature with something simple like:

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?

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

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 :wink:

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
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

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

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

 man xhost

to find a more secure form like only allowing from your local host.

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

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)

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…

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)