You are not logged in.

#1 2011-10-27 20:37:35

haiku
Member
From: Chambery, France
Registered: 2011-01-28
Posts: 19

[SOLVED] "at" command can't seem to run jobs

Hi!

Well, I'm stuck, I can't seem to figure how to run a command with "at"....

The atd daemon is running:
"daemon    5060  0.0  0.0  10172   484 ?        Ss   21:09   0:00 /usr/sbin/atd"

I've created an /etc/at.allow file, with my username.

So, I'm trying:
at -f /home/mathieu/fg.sh -v 22h35

The atq command list my job:
23    Thu Oct 27 22:35:00 2011 a mathieu

But, when 22h35 comes, well nothing happens.
I've also tried with the at prompt, without luck...
(and the script is marked as executable)

Any idea what I'm doing wrong?

Last edited by haiku (2011-10-29 08:03:01)


Hasta la Singularidad Siempre

Offline

#2 2011-10-27 23:06:16

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: [SOLVED] "at" command can't seem to run jobs

No messages logged in /var/log/messages or /var/log/everything with an explanation?

Offline

#3 2011-10-27 23:13:11

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: [SOLVED] "at" command can't seem to run jobs

Is fg.sh a bash script or a sh script? AFAIK, cron expects sh and doesn't like bash; maybe you have the same problem with `at'?

Offline

#4 2011-10-27 23:28:26

haiku
Member
From: Chambery, France
Registered: 2011-01-28
Posts: 19

Re: [SOLVED] "at" command can't seem to run jobs

The only messages in /var/log/everything that maybe related are:
Oct 27 22:03:53 localhost atd[5504]: Cannot change to /var/spool/atd: Permission denied
[I've tried launching "at" as root, without success]
and this one, but that wouldn't prevent anything:
Oct 27 22:01:00 localhost atd[5454]: Exec failed for mail command: No such file or directory

Nothing in /var/log/messages.

fg.sh is a bash script (actually, just a "echo" command, for testing)
I've also tried to launch echo directly with at, like:

$at 22h40
>at echo "test"
>at <EOT>

without any result..


Hasta la Singularidad Siempre

Offline

#5 2011-10-27 23:43:31

/dev/zero
Member
From: Melbourne, Australia
Registered: 2011-10-20
Posts: 1,247

Re: [SOLVED] "at" command can't seem to run jobs

I created a sh script called fg.sh and found the following:

  • Remember to use absolute path names eg /bin/echo;

  • Remember to make fg.sh executable;

  • I had to use sudo (but I don't have an at.allow file so maybe you don't need to worry - but you could use sudo until you know you at least have something working);

  • Direct the result to a file or something - attempting to use echo without redirecting the output anywhere didn't produce any (visible) results for me, but the file appeared when told to.

Caveat: I'm stuck on an ubuntu machine at the moment so ymmv.

Offline

#6 2011-10-28 00:01:24

haiku
Member
From: Chambery, France
Registered: 2011-01-28
Posts: 19

Re: [SOLVED] "at" command can't seem to run jobs

Well, it worked (as a regular user) with the redirection - thanks!


Hasta la Singularidad Siempre

Offline

#7 2011-10-28 02:53:03

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,703

Re: [SOLVED] "at" command can't seem to run jobs

jt512 wrote:

I think you need to list your user name in /etc/at.allow. Maybe that will allow you to avoid the redirection shenanigans.

In case you are wondering what happened to your post, at 19:50, I bet you hit the "Report" button rather than the "Reply" button and accidentally reported this thread to the mods.  It happens all the time.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB