I'd like to disable
at mail notifications for a certain class of jobs. For example, when testing the use case below (killing an at job midstream) I don't want output, but the same code in production I do want the mailed output:
$ at now <<<'/usr/bin/timeout 15s nc -l 20242' job 71 at 2016-05-16 15:03 $ pidof /usr/bin/timeout 11853 $ kill 11853 $ mail Heirloom Mail version 12.4 7/29/08. Type ? for help. "/var/spool/mail/bishop": 1 message 1 new >N 1 bishop@trencher Mon May 16 15:03 16/920 "Output from your job 71" & 1 Message 1: From bishop@trencher Mon May 16 15:03:30 2016 Date: Mon, 16 May 2016 15:03:30 -0400 From: bishop@trencher Subject: Output from your job 71 To: bishop@trencher Status: R /bin/bash: line 1: 11853 Terminated /usr/bin/timeout 15s nc -l 20242
I know I can set
MAILPATH=/dev/null, but I'd prefer to have more fine grained control. Setting
MAILTO have had no obvious effect. I thought I could edit the job to remove the
at 15:15 <<<'date' at -c 73 | grep -v '^# mail bishop' | at 15:15 atrm 73
I've searched high and low, but let's just say searching for a command named at is non-trivial. I can't even seem to find the at source code: isn't it in GNU coreutils?
UPDATE: Station identification:
$ uname -a Linux trencher 4.4.8-20.46.amzn1.x86_64 #1 SMP Wed Apr 27 19:28:52 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux $ at -V at version 3.1.10
Is it possible to control, per job, whether the output -- any output -- is mailed to the submitting user?