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:


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

6 Years
Discussion Span
Last Post by alex.sergeev.311

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.

Edited by roshan_iiita



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


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

here's an example of script:

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

new record broadcast enabled
setup record input ""
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


Use vlc args -I dummy with at command

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.