Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Apr 2008 13:54:52 +0000 (UTC)
From:      D Hill <d.hill@yournetplus.com>
To:        Lowell Gilbert <freebsd-questions-local@be-well.ilk.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: [freebsd-questions] cronjob - email messages sent
Message-ID:  <alpine.BSF.1.10.0804071351190.72128@duane.dbq.yournetplus.com>
In-Reply-To: <44iqytn5sf.fsf@be-well.ilk.org>
References:  <alpine.BSF.1.10.0804042327290.20308@duane.dbq.yournetplus.com> <44iqytn5sf.fsf@be-well.ilk.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 7 Apr 2008 at 09:38 -0400, freebsd-questions-local@be-well.ilk.org...:

> D Hill <d.hill@yournetplus.com> writes:
>
>> I have several cronjob's set up on a server we have under the user root. I
>> need to specify specific email addresses results are sent to.
>>
>> Using documentation from:
>>
>>   man 5 crontab
>>
>> I thought I could surround the jobs:
>>
>>   ...
>>   MAILTO="root,someoneelse"
>>   @hourly /usr/local/bin/mysqladmin -u internalonly status
>>   30 8 * * * /usr/local/bin/mysql -u internalonly < /root/mysql.optimize
>>   */15 * * * * mysql -u internalonly < /root/delete_rad_usersonline
>>   0 */4 * * * mysql -u internalonly < /root/delete_rad_authlog_failed
>>   MAILTO="root"
>>   ...
>>
>> It works for @hourly, but not for the other three.
>
> I don't have a chance to look into it now, but it should definitely
> work the way you have done it.  [I usually invoke sendmail directly on
> the crontab line if I want mail output, so I haven't any experience to
> draw on here.]
>
> You might want to check whether the order of the schedule lines matters.

It is working. Checking the man page for cron:

   %man cron
   ...
   The cron utility then wakes up every minute, examining all stored
   crontabs, checking each command to see if it should be run in the
   current minute.

>From this, I gathered they were read from top to bottom.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.1.10.0804071351190.72128>