How to supress "Syntax OK" after apache2ctl

How to supress "Syntax OK" after apache2ctl

am 31.10.2007 11:35:11 von mark

Hi community,

i wan't to use "apache2ctl configtest" inside my cron.
this works perfect but every time the cron runs a cronmail will be
send to my adress. my intention is to get rid of this mails with no
error inside.

does anyone has a solution for me?

thx

mark

Re: How to supress "Syntax OK" after apache2ctl

am 31.10.2007 12:06:56 von mark

On 31 Okt., 11:35, mark wrote:
> Hi community,
>
> i wan't to use "apache2ctl configtest" inside my cron.
> this works perfect but every time the cron runs a cronmail will be
> send to my adress. my intention is to get rid of this mails with no
> error inside.
>
> does anyone has a solution for me?
>
> thx
>
> mark

Solution found myself

apache2ctl configtest 2>&1|grep -v 'Syntax OK'

Re: How to supress "Syntax OK" after apache2ctl

am 31.10.2007 12:17:49 von clbr

On Oct 31, 10:35 am, mark wrote:
> Hi community,
>
> i wan't to use "apache2ctl configtest" inside my cron.
> this works perfect but every time the cron runs a cronmail will be
> send to my adress. my intention is to get rid of this mails with no
> error inside.
>
> does anyone has a solution for me?
>
> thx
>
> mark

Solution 1: */8 * * * * apache2ctl configtest > /dev/null 2>&1.
Nothing will be sent to you even if error come up. Then you need to
take a look at crontab log to find out if some errors come up. Don't
like this approach.

Solution 2: just write a few lines script(i.e) in python which would
execute apache2ctl configtest. If the output would be 'Syntax OK' do
not print anything if output!="Syntax ok" - print it. Then put the
script to cron(without /dev/null ...). Whenever error comes up you
will get an email

Hope that help.