Re: Crontab, Scripting and Syslog (solved)
On Mon, 02 Jul 2012 15:07:46 +0100
Chris Davies <chris-usenet@roaima.co.uk> wrote:
> Titanus Eramius <titanus@aptget.dk> wrote:
> > * 04 * * * /home/titanus/scripts/web-log >> /dev/null 2>&1
>
> > The line runs every morning at 4, and AFAIK, the /dev/-part should
> > redirect all but errors to null.
>
> No.
>
> 1. This runs every minute while the hour is 4. If you want the script
> to run only a 4am, you need to specify a zero minute value too
>
> 2. The ">> /dev/null 2>&1" tells cron to thow away not just errors but
> also all normal output. If you want to lose information written to
> stderr (typically errors), then you need "2> /dev/null"
>
> 0 4 * * * /home/titanus/scripts/web-log 2>/dev/null
>
> Chris
>
>
Thank you for the corrections, the first part works now, and
the second part will probaly be tested by some future error.
Cheers
Reply to: