From owner-freebsd-questions@FreeBSD.ORG  Sat Sep  3 21:42:26 2011
Return-Path: <owner-freebsd-questions@FreeBSD.ORG>
Delivered-To: questions@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9F4241065672
	for <questions@freebsd.org>; Sat,  3 Sep 2011 21:42:26 +0000 (UTC)
	(envelope-from brett@lariat.net)
Received: from lariat.net (lariat.net [66.119.58.2])
	by mx1.freebsd.org (Postfix) with ESMTP id 366FA8FC0C
	for <questions@freebsd.org>; Sat,  3 Sep 2011 21:42:25 +0000 (UTC)
Received: from WildRover.lariat.net (IDENT:ppp1000.lariat.net@lariat.net
	[66.119.58.2]) by lariat.net (8.9.3/8.9.3) with ESMTP id PAA27491;
	Sat, 3 Sep 2011 15:42:20 -0600 (MDT)
Message-Id: <201109032142.PAA27491@lariat.net>
X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9
Date: Sat, 03 Sep 2011 15:42:20 -0600
To: Robert Bonomi <bonomi@mail.r-bonomi.com>, questions@freebsd.org
From: Brett Glass <brett@lariat.net>
In-Reply-To: <201109032035.p83KZfse010717@mail.r-bonomi.com>
References: <201109031639.KAA25689@lariat.net>
	<201109032035.p83KZfse010717@mail.r-bonomi.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Cc: 
Subject: Re: "at" command and mail
X-BeenThere: freebsd-questions@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: User questions <freebsd-questions.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-questions>, 
	<mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions>
List-Post: <mailto:freebsd-questions@freebsd.org>
List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-questions>, 
	<mailto:freebsd-questions-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 03 Sep 2011 21:42:26 -0000

At 02:35 PM 9/3/2011, Robert Bonomi wrote:
 
>Is 'atrun' actually sending the mails or is 'cron' doing it?  'atrun' is
>invoked by 'cron', from a specification in the system crontab file.

/usr/src/libexec/atrun/atrun.c shows an invocation of sendmail(8) directly
from atrun(8).

>Cron emails *whenever* a cron-scheduled job produces stdout or stderr
>output.

atrun intentionally doesn't produce output unless it encounters an error;
see the same source file.

>You could, in theory, have the crontab line _append_ output to a filename
>based on a timestamp, however, that intermixes output from all users.

One way to avoid problems would be to create a file name from a timestamp
and a pid.

The key thing, though, is to avoid mailing on machines that don't have
mail.

--Brett