[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Crontab, Scripting and Syslog



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


Reply to: