Koozali.org: home of the SME Server

Legacy Forums => Experienced User Forum => Topic started by: Des Dougan on August 19, 2002, 10:51:01 AM

Title: Cron output question
Post by: Des Dougan on August 19, 2002, 10:51:01 AM
I've set up a custom template in cron.d for a job that will run hourly. Is there any way to stop this particular job's output from being mailed to root? I don't want it to be mailed at all, in fact, as I'm not interested in seeing it. I do want to continue to see the output from other daily and weekly jobs.

Thanks,

Des Dougan
Title: Re: Cron output question
Post by: Chris on August 19, 2002, 05:42:17 PM
* * * * * * mycommand >> /home/user/cron.log 2>&1

will log stdout and stderr to to /home/user/cron.log Des Dougan wrote:
>
> I've set up a custom template in cron.d for a job that will
> run hourly. Is there any way to stop this particular job's
> output from being mailed to root? I don't want it to be
> mailed at all, in fact, as I'm not interested in seeing it. I
> do want to continue to see the output from other daily and
> weekly jobs.
>
> Thanks,
>
> Des Dougan
Title: Re: Cron output question
Post by: Darrell May on August 20, 2002, 04:33:16 AM
or since Des stated:

> in fact, as I'm not interested in seeing it.

you can do this and not even bother to log the output at all:

* * * * * * mycommand > /dev/null 2>&1

Darrell
Title: Re: Cron output question
Post by: Des Dougan on August 20, 2002, 08:29:29 AM
Chris and Darrell, thanks.

I was on the right track, but I found I had to enclose the command (a wget command with parameters)  in quotes to get it to work properly.

Des