at does not work

Hi,

I do not get how the at command works. The goal is to use at with the -m option (http://www.freebsd.org/cgi/man.cgi?query=at&sektion=1) and then use mailx to see the "output". But even the simple echo "hello" |at -m 16:22 16.07.2014 does not work. It then says
Code:
Job # will be executed using /bin/sh
but at -l shows that the job does not get executed at the given time.

If I execute the above command without the -m option the job also does not get executed but disappears from the queue a few minutes after the set execute time.

Any help would be gladly appreciated.
 
Code:
user@machine~% sudo at 20:43 16.07.2014
DISPLAY=:0 lxterminal
Ctrl-d

works, but it seem not to work with echo. It's something with the Enviroment.
 
Thank you for your reply @talsamon it really helped me. Yes, it seems like it has something to do with the echo command not working. ls | at -m 22:00 16.07.2014 works just fine. Also it seems like it can only handle some of the basic commands and that only without any options.
 
Last edited by a moderator:
echo "hello" | at ... means that it will try to execute the command hello, which there is none. I think you are going for echo 'echo "hello"' | at ....
 
But
Code:
echo "echo hier" >> echo.txt| at 01:06 17.07.2014
less echo.txt 
echo hier
and that leads to the solution:
Code:
echo "echo hier" > /dev/pts/1 |at 1:32
echo hier
 
talsamon said:
but:
echo "echo hier" >> echo.txt| at 01:06 17.07.2014

Should probably be echo "echo hier >> echo.txt" | at 01:06 17.07.2014 if I am understanding you correctly. You can look under /var/at/jobs/xxxx where the xxxx is some string to look at the actual script and see the environmental variables and commands that actually get put in. It's just a shell script and all right there to look at. You shouldn't have to be guessing or using much trial and error.
 
Back
Top