"at" command and mail

Adam Vande More amvandemore at gmail.com
Sun Sep 4 02:26:57 UTC 2011

On Sat, Sep 3, 2011 at 4:42 PM, Brett Glass <brett at lariat.net> 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:

if [ -e /usr/sbin/sendmail ]; then
  echo $OUTPUT | mail -s "Subject" $USER
  echo $OUTPUT > ${USER}_`date +\%Y\%m\%d`.log

Adam Vande More

More information about the freebsd-questions mailing list