I am trying to run a shell script at a fixed time with the help of "at" command. But it doesn't seem to work.
For example, I created a shell script named as "task" having content:

vlc

and schedule it to run at 21:52 with the command:

$at -f task 21:52

it shows message:

warning: commands will be executed using /bin/sh
job 16 at Thu Apr 26 21:52:00 2012

but it doesn't work.
I tried giving the vlc command directly to at command, but it also doesn't work.
It seems like "at" command doesn't work for all the commands or scripts because it works for commands like "echo".
Please help me...!!

does it not have cron?

It has cron also. But I need to run the commands only once. Actually I am making a java program which will take input from the user that at which time any command has to be executed. So, I thought to place those commands in a shell file and then schedule to run the commands in the shell file by using "at" command. If I use "cron" command then it will be scheduled to run again and again after a fix interval, which I don't want.

Hello,

you have to tell 'at' which display it must use. So for example, if you want to launch vlc at 21:52 you should type :
~$ at 21:52
warning: commands will be executed using /bin/sh
at> env DISPLAY=:0 vlc

Then ctrl + D.

The 'env DISPLAY=:0' will tell 'at' to use the current display which is probably the desktop.

Also you may have to add the hostname 'localhost' to the list allowed to make connections to the X server by typing :

~$ xhost +local:

@malrob: Thanks... vlc command worked. But shell script is still not working. Can you help me in this please.

Hello roshan iiita,
Did you find a solution to run vlc in at command?
In fact, I have the same problem than you!

Thx in advance for your reply, pamsb2

hello,
As i find a way to schedule use of videolan i share it!
First launch vlc with telnet interface:

vlc -I telnet

then start to communicate with the instance you've just launched (password is admin):

telnet localhost 4212

finally load the script of your choice to program it and loggout:

>load my_script.sh
>bye

here's an example of script:

# VLC media player VLM command batch
# http://www.videolan.org/vlc/

new record broadcast enabled
setup record input "http://91.121.22.39:8010/"
setup record output #std{access=file,mux=mp3,dst=/home/seb/galax2.mp3}
new start schedule date 2013/2/17-14:0:0 enabled

setup start append control record play
new end schedule date 2013/2/17-16:0:0 enabled

setup end append control record stop

further information on command syntax can be found on vlc wiki's web site!
Bye Pamsb2

Member Avatar for alex.sergeev.311

Use vlc args -I dummy with at command

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.