On Oct 31, 10:35 am, mark <data4....RemoveThis@gmail.com> 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.
>> Stay informed about: How to supress "Syntax OK" after apache2ctl