At is not working in ubuntu 12.04

Asked by prasad.ram

Hi i am using ubuntu 12.04
in that at command is not working
i used like this
at 10:12
echo hia
then press Ctrl+D
it is activated.If i use atq command before 10:12 it shows the job after that it shows nothing
but i did not get out put.So can you please help me
Thanks in advance

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu sudo Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

andy@fileserver:~$ at 12:40
warning: commands will be executed using /bin/sh
at> echo "test" | tee ~/test.txt
at> <EOT>
job 2 at Wed Oct 23 12:40:00 2013
andy@fileserver:~$ date
Wed Oct 23 12:36:55 BST 2013
                   .
                   .
               later
                   .
                   .
andy@fileserver:~$ date
Wed Oct 23 12:39:22 BST 2013
andy@fileserver:~$ ls
Desktop Downloads Music Public Videos
Documents Dropbox Pictures Templates
andy@fileserver:~$ date
Wed Oct 23 12:40:01 BST 2013
andy@fileserver:~$ ls
Desktop Downloads Music Public test.txt
Documents Dropbox Pictures Templates Videos
andy@fileserver:~$ cat ./test.txt
test
andy@fileserver:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.3 LTS
Release: 12.04
Codename: precise

Works fine

Revision history for this message
Manfred Hampl (m-hampl) said :
#2

Where did you expect to get the output?
The at command is executed in a completely different environment that your terminal window.
I am sure that the at command worked well, and that it has echoed the string "hia" to its own output that (according to "man at") should have been mailed to you - but I guess you will not have set up your system as mail server for that to work.

Better define where the command should store its output in a manner like actionparsnip has shown in his answer
e.g.
at 10:12
echo hia >> ~/myatjob.log

Revision history for this message
prasad.ram (prasad-ram126) said :
#3

I got it but i would like execute commands
for e.g
at 22:50
at>shutdown +30
at><EOT>
at>
but it is not working.can you please tell me is it possible or not?
Thanks in advance

On 23/10/2013, Manfred Hampl <email address hidden> wrote:
> Your question #237893 on sudo in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/sudo/+question/237893
>
> Manfred Hampl proposed the following answer:
> Where did you expect to get the output?
> The at command is executed in a completely different environment that your
> terminal window.
> I am sure that the at command worked well, and that it has echoed the string
> "hia" to its own output that (according to "man at") should have been mailed
> to you - but I guess you will not have set up your system as mail server for
> that to work.
>
> Better define where the command should store its output in a manner like
> actionparsnip has shown in his answer
> e.g.
> at 10:12
> echo hia >> ~/myatjob.log
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/ubuntu/+source/sudo/+question/237893/+confirm?answer_id=1
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+source/sudo/+question/237893
>
> You received this question notification because you asked the question.
>

Revision history for this message
prasad.ram (prasad-ram126) said :
#4

I got it but i would like execute commands
for e.g
at 22:50
at>shutdown +30
at><EOT>
at>
but it is not working.can you please tell me is it possible or not?
Thanks in advance

On 23/10/2013, Manfred Hampl <email address hidden> wrote:
> Your question #237893 on sudo in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/sudo/+question/237893
>
> Manfred Hampl proposed the following answer:
> Where did you expect to get the output?
> The at command is executed in a completely different environment that your
> terminal window.
> I am sure that the at command worked well, and that it has echoed the string
> "hia" to its own output that (according to "man at") should have been mailed
> to you - but I guess you will not have set up your system as mail server for
> that to work.
>
> Better define where the command should store its output in a manner like
> actionparsnip has shown in his answer
> e.g.
> at 10:12
> echo hia >> ~/myatjob.log
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/ubuntu/+source/sudo/+question/237893/+confirm?answer_id=1
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+source/sudo/+question/237893
>
> You received this question notification because you asked the question.
>

Revision history for this message
Enrico Rosina (e-rosina) said :
#5

Hello,

I found this in the "man" :
 -t time run the job at time, given in the format [[CC]YY]MMDDhhmm[.ss]

I did not have any job registered, so I simply tried:

at -t 201310232035 -c sample

Result:

at: unknown jobid: sample

At least I think that the time given was accepted
Maybe you can investigate further with this hint

Good luck
Enrico

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#6

With the shutdown command you might run into access rights limitations. Your user most probably is not authorized to execute shutdown without sudo, and "sudo shutdown" cannot be used as there is noone to enter the password at the time when shutdown is due to be executed.
You might have to execute the whole at command in an administrative environment.
Maybe something like

sudo at 10:30
> shutdown -P

does what you want.
There are also some GUI-programs for scheduling shutdowns like gshutdown, easyshutdown etc.
Maybe one of these can do what you want.
Whan can't you just use "sudo shutdown +30" and leave your used logged in?

Revision history for this message
prasad.ram (prasad-ram126) said :
#7

Thanking you for your help