----- Original Message ----- 
From: "Jakub M" <[EMAIL PROTECTED]>
To: "MRTG list" <[email protected]>
Sent: Monday, December 01, 2008 3:38 PM
Subject: [mrtg] mrtg, cron and exim problem...


>I have noticed a problem at junction of MRTG, cron and exim, so mot
> 'pure' mrtg problem, but you might know the solution. I receive on a
> local mail regularly informations:
>
> /bin/sh: -c: line 0: syntax error near unexpected token `then'
> /bin/sh: -c: line 0: `root      if [ -x /usr/bin/mrtg ] && [ -r
> /etc/mrtg/mrtg-vlan-traffic.cfg ]; then env LANG=C /usr/
> bin/mrtg /etc/mrtg/mrtg-vlan-traffic.cfg >> /var/log/mrtg/mrtg.log 2>&1; 
> fi'
>
> that is send by Cron Daemon. But the line is a original line that
> should run MRTG and normally, when I try it in a command line, it
> works. Do you have any Idea what's going on?


When you run the command on the command line, you may be using another shell 
and/or other settings.

Perhaps cron handles '&&' different from what you expect.

Try creating a small script. The 1st line contains "#!/bin/bash" (use the 
shell you're using, and adjust its path if necessary).

Put the command in that script and run the script from cron. Does that work? 

_______________________________________________
mrtg mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg

Reply via email to