user3917144
user3917144

Reputation: 43

Jobs executed using at command hangs

I have bash script test.sh which runs a simple command as below

echo "test" >> /d2/tmp/test.txt

Now I invoke this as below

[root@labtspc1rg03 tmp]# at now < test.sh
job 574 at 2015-12-30 05:26 

Now this job never gets executed.

[root@labtspc1rg03 tmp]# atq
574     2015-12-30 05:26 = root
573     2015-12-30 05:26 = root

there were 2 jobs which i had scheduled,if you notice there is an equal sign in each job If I understand correctly equal means that its currently running job but there is no output for the job seen i.e output is empty. I expected output of every job is sent to /var/spool/at/spool/

[root@labtspc1rg03 spool]# cat a0023e017120d2
Subject: Output from your job      574
To: root
<EMPTY> 

There are no privileges set either in /etc/at.deny or /etc/at.allow file.

I would like to know what can I check to get the reason why this job was not executed and also I noticed that the job exited on it's own after some 2 hours or so, is there some default config which triggered this?

Upvotes: 0

Views: 111

Answers (1)

Benedikt K&#246;ppel
Benedikt K&#246;ppel

Reputation: 5119

at now < test.sh executes test.sh immediately and then sends the output of test.sh into at. So at will then execute test.

To execute the test.sh script, you can do either:

echo "/path/to/your/script/test.sh" | at now

or

at -f "/path/to/your/script/test.sh" now

Upvotes: 1

Related Questions