From owner-freebsd-questions@FreeBSD.ORG Sun Sep 4 02:26:57 2011 Return-Path: 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 D8C9F106564A for ; Sun, 4 Sep 2011 02:26:57 +0000 (UTC) (envelope-from amvandemore@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6FFF18FC0A for ; Sun, 4 Sep 2011 02:26:57 +0000 (UTC) Received: by fxe4 with SMTP id 4so3481896fxe.13 for ; Sat, 03 Sep 2011 19:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=oB5WTcBP2ZU+GTXHxGXKupiATRwYfnJGr/ye5C8g4AI=; b=i7n6/sPc9l817hd8TtirweGglLsOq7omUVxXkYX4fsTVOQn5FC4+jYzqmjc86sRK11 MoDEcXfQHqpa9gAmJhGQwn3sq46dYHtoo4zqjleFatSXkFEbq3yEz9xvsF7ZpnBiObMC 8VTgIBb66OHUu2fp8ZW+9YcoV4bBFIvJfcyck= MIME-Version: 1.0 Received: by 10.223.55.205 with SMTP id v13mr3072383fag.88.1315103216142; Sat, 03 Sep 2011 19:26:56 -0700 (PDT) Received: by 10.223.120.72 with HTTP; Sat, 3 Sep 2011 19:26:56 -0700 (PDT) In-Reply-To: <201109032142.PAA27491@lariat.net> References: <201109031639.KAA25689@lariat.net> <201109032035.p83KZfse010717@mail.r-bonomi.com> <201109032142.PAA27491@lariat.net> Date: Sat, 3 Sep 2011 21:26:56 -0500 Message-ID: From: Adam Vande More To: Brett Glass Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: questions@freebsd.org, Robert Bonomi Subject: Re: "at" command and mail X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Sep 2011 02:26:57 -0000 On Sat, Sep 3, 2011 at 4:42 PM, Brett Glass wrote: > > 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. > Call a shell script which preforms the actions you want. Regular old /bin/sh scripting is a worthwhile skill: Something quick: #!/bin/sh OUTPUT=$(your/app) if [ -e /usr/sbin/sendmail ]; then echo $OUTPUT | mail -s "Subject" $USER else echo $OUTPUT > ${USER}_`date +\%Y\%m\%d`.log fi -- Adam Vande More