SELF-SUMMARY: at and batch quirks

From: Lucio Chiappetti <lucio_at_ifctr.mi.cnr.it>
Date: Tue, 05 Sep 2000 18:55:13 +0200 (MET DST)

I have a DU 3.2 (oh yes it has to be left alone) system on which in some
occasional CGI script I used the following construct to get rid of temporary
files :

at now + 1 minute <<END
rm -f /tmp/quanti.html
END

On such system (because I did not by purpose install the Y2K patches)
I get an "at : bad year" error.

I replaced the construct with

batch <<END
sleep 60
rm -f /tmp/quanti.html

and the construct works. Only I receive the following very curious message
after the successful execution of the batch (the curious thing is that the
message mentions "pine" ! is this message generated by batch, or by pine (yes
I do use pine for mail) receiving some illegal stuff ?)

-------------------------------------------------------------------------
body of message from root follows
-------------------------------------------------------------------------
Cannot find terminal.
Can't access terminal or input is not a terminal. Redirection of
standard input is not allowed. For example "pine < file" doesn't work.
^G

*************************************************
Cron: The previous message is the standard output
      and standard error of one of your cron commands.
-------------------------------------------------------------------------

I tried various options of redirection (e.g. batch << END >& /dev/null)
but still I receive the mail.

I tried the same construct on a Tru64 5.0 system, and the curious thing there
is that I *ALWAYS* receive a mail message from ANY "batch" command saying
something like this :

at: Job prova.968172211.b was run.

I cannot get rid of it.

Finally I found it ! On both systems "batch" is a script aliased to
at -qb -m

It's the -m switch which is carved in stone there !

So finally my construct works as follows

at -qb <<END
sleep 60
rm -f /tmp/quanti.html

----------------------------------------------------------------------------
Lucio Chiappetti - IFCTR/CNR - via Bassini 15 - I-20133 Milano (Italy)
For more info : http://www.ifctr.mi.cnr.it/~lucio/personal.html
----------------------------------------------------------------------------
Received on Tue Sep 05 2000 - 16:59:55 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:41 NZDT