Unix Programming - suppress output of at job

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > July 2004 > suppress output of at job





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author suppress output of at job
John Galt

2004-07-16, 5:53 pm

I have this self-scheduling at job:

[belgium.cs] $ cat dobackup.sh
## self-perpetuating at job
at now tomorrow </u/jgalt/dobackup.sh >/dobackup.out 2>&1
....
ls -l backup.tar.gz | mail jgalt

I get output from the job itself and that's all cool. But I see
spurious mail like the below every day (inspite of redirecting the
at).

Your "at" job on belgium.cs
"/var/spool/cron/atjobs/1082446861.a"

produced the following output:

commands will be executed using /bin/bash
job 1090023262.a at Fri Jul 16 20:14:22 2004

Why does this happen and how can I stop it? (Note that the first
invocation redirected the output as well.)

Thanks in advance,
John
Joe Chung

2004-07-16, 5:53 pm

johngalt__@hotmail.com (John Galt) writes:

> I have this self-scheduling at job:
>
> [belgium.cs] $ cat dobackup.sh
> ## self-perpetuating at job
> at now tomorrow </u/jgalt/dobackup.sh >/dobackup.out 2>&1
> ...
> ls -l backup.tar.gz | mail jgalt
>
> I get output from the job itself and that's all cool. But I see
> spurious mail like the below every day (inspite of redirecting the
> at).
>
> Your "at" job on belgium.cs
> "/var/spool/cron/atjobs/1082446861.a"
>
> produced the following output:
>
> commands will be executed using /bin/bash
> job 1090023262.a at Fri Jul 16 20:14:22 2004
>
> Why does this happen and how can I stop it? (Note that the first
> invocation redirected the output as well.)
>
> Thanks in advance,
> John


This was just discussed a few months ago.
I think the answer was to do:

exec >/dev/null 2>&1
or
exec >somelogfile 2>&1

as the very first line of your script so that your script does
not produce any output.

See:

http://groups.google.com/groups?th=...n12.cac.psu.edu

Search in groups.google.com using the term
"at command" email

Double quotes are necessary around "at command" to prevent google
from throwing away naked "at" as a common word.

-jc
--
(apply 'concat (reverse (list "com"
(char-to-string 46) "yahoo"
(char-to-string 64) "joechung")))
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com