e-mail from cron

Alex Zbyslaw xfb52 at dial.pipex.com
Wed Aug 23 14:25:17 UTC 2006


Lisa Casey wrote:

>
> # Perform daily/weekly/monthly maintenance.
> 1       3       *       *       *       root    periodic daily  2>&1 | 
> sendmail service at jellico.com
> 15      4       *       *       6       root    periodic weekly 2>&1 | 
> sendmail service at jellico.com
> 30      5       1       *       *       root    periodic monthly 2>&1 
> | sendmail service at jellico.com
> #
>
If these were standard cronjobs sending output to stdout then this would 
work (though I would use e.g. "mail -s 'my subject'" not sendmail - 
latter only really useful when you want to generate the headers 
yourself).  However, IIRC, periodic jobs are handled differently.  
Extract from man periodic.conf:

dir_output
     (path or list) What to do with the output of the scripts executed
     from the directory dir.  If this variable is set to an absolute
     path name, output is logged to that file, otherwise it is taken
     as one or more space separated email addresses and mailed to
     those users.  If this variable is not set or is empty, output is
     sent to standard output.

e.g.
daily_output=service at jellico.com

same for weekly, monthly.

Or unset all of them and use the crontab email method you used above.

--Alex




More information about the freebsd-questions mailing list