Help with the 'at' command...

leftyleo

New Member
Joined
Aug 6, 2024
Messages
17
Reaction score
5
Credits
142
"at" didnt come installed i had to sudo apt install at
I then did

Bash:
:~$ at now+5min
warning: commands will be executed using /bin/sh
at> echo "Hello"
at>
at> <EOT>
job 5 at Mon Sep  2 12:38:00 2024
:~$

it shows job 5 queued (i tried a few times)
even with atq

Bash:
5    Mon Sep  2 12:38:00 2024 a leftyleo

Nothing happened at 12:38

i tried with sudo even though there was no indication that it was required and I
also tried by creating /etc/at.allow containing "leftyleo" (all lower as it is in the bash banner)

no outputs ate the specified time either way .. read the man and that didnt help
although if i put teatime - it DID set to 4pm ..

(PS should replies to this be in a new/separate thread?)

Thank you
 
Last edited:


(PS should replies to this be in a new/separate thread?)
AS long as your replies are on topic, then they are probably just fine here....However, this topi started in 2013, its latest reply was 2022....so the chances of someone seeing your reply etc etc are probably a bit remote....maybe ?
 
"at" didnt come installed i had to sudo apt install at
I then did

Bash:
:~$ at now+5min
warning: commands will be executed using /bin/sh
at> echo "Hello"
at>
at> <EOT>
job 5 at Mon Sep  2 12:38:00 2024
:~$

it shows job 5 queued (i tried a few times)
even with atq

Bash:
5    Mon Sep  2 12:38:00 2024 a leftyleo

Nothing happened at 12:38

i tried with sudo even though there was no indication that it was required and I
also tried by creating /etc/at.allow containing "leftyleo" (all lower as it is in the bash banner)

no outputs ate the specified time either way .. read the man and that didnt help
although if i put teatime - it DID set to 4pm ..

(PS should replies to this be in a new/separate thread?)

Thank you
The question arises as to where you want "Hello" to appear. As written, if in a terminal, it normally appears almost immediately in the terminal that the echo command is written, but maybe you need to instruct the at command where to write it to, for example:
Code:
echo "Hello" > /dev/tty4
and then check the tty4 console which is likely at ctl+alt+F4.

If you are just using a terminal in a GUI without changing to the console terminals, you can test the at command with a more specific command like the following, for example:
Code:
echo "Hello" > /tmp/atTest.txt
and then check whether the file atTest.txt appears at the specified time in the /tmp directory with the contents: Hello. It likely will if all things are in order.
 
(PS should replies to this be in a new/separate thread?)

This should probably be a thread on its own, probably in the 'Command Line' sub-forum.
 
In fact, consider it moved and a new thread created. ;-)

You're welcome.
 
The question arises as to where you want "Hello" to appear. As written, if in a terminal, it normally appears almost immediately in the terminal that the echo command is written, but maybe you need to instruct the at command where to write it to, for example:
Code:
echo "Hello" > /dev/tty4
and then check the tty4 console which is likely at ctl+alt+F4.

If you are just using a terminal in a GUI without changing to the console terminals, you can test the at command with a more specific command like the following, for example:
Code:
echo "Hello" > /tmp/atTest.txt
and then check whether the file atTest.txt appears at the specified time in the /tmp directory with the contents: Hello. It likely will if all things are in order.

But shouldnt it default to appear in the command window where it was created ? i have to searching tty's or dump to a file --i cant just use it like a timer / reminder? though yes i would do more useful things with it but i wanted to do proof of concept type basic stuff first
 
But shouldnt it default to appear in the command window where it was created ? i have to searching tty's or dump to a file --i cant just use it like a timer / reminder? though yes i would do more useful things with it but i wanted to do proof of concept type basic stuff first
From the manpage here: https://man7.org/linux/man-pages/man1/at.1p.html
The at-job shall be executed in a separate invocation of the
shell, running in a separate process group with no controlling
terminal
I guess this means you have to tell at where to direct its output.
To use it as a reminder, for example, with a message to appear on the desktop at a certain time, that can be scripted using a number of means. A simple one to use is xmessage in such a script which will display a message on screen of a system running X.
 
Last edited:
i will read the man again .. sometimes they are so hard to follow ..
thank you
onward to more experiments
 
I never used AT a lot, and the things I could or should run in AT, I always run in CRONTAB

Not saying you should as well, just saying either can run scheduled jobs. Usage is quite different though.
I never needed to install Crontab, for example :)
 


Top