Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Sep 2020 16:22:22 +0300
From:      xtouqh@mm.st
To:        Per olof Ljungmark <peo@nethead.se>, FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: How to silence cron?
Message-ID:  <41377ad1-4162-1194-7172-234c4d172e6d@mm.st>
In-Reply-To: <b0f49812-4d0a-e301-3ef2-816431ae3dbe@nethead.se>
References:  <b0f49812-4d0a-e301-3ef2-816431ae3dbe@nethead.se>

next in thread | previous in thread | raw e-mail | index | archive | help
Per olof Ljungmark wrote:
> Hi,
> 
> What would be the proper way to silence output from a php script running 
> under cron? I have tried variations of /dev/null and 2>&1 but getting 
> nowhere.
> 
> Abbriviated crontab looks like
> 
> SHELL=/bin/sh
> PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
> MAILTO="someimportantperson"
> 
> */5 * * * * su -m www -c "/usr/local/bin/php 
> /usr/local/www/pathtoscript.php"
> 
> Roots shell is FBSD standard csh
> www's shell is /usr/sbin/nologin
> 
> With the rest of the crons I do want mail to be sent, just not this one.

crontab(5) describes -n, which will silence only the successful runs, i.e:

*/5 * * * * -n su -m www -c "...."

If that works for you, good.  If not, how *exactly* you used the 
redirections?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41377ad1-4162-1194-7172-234c4d172e6d>