exim crontab eintrag verursacht fehler

Jan-Benedict Glaw jbglaw at lug-owl.de
Tue Nov 22 18:05:43 CET 2005


On Tue, 2005-11-22 18:00:39 +0100, Stefan Pump <lug at jspweb.net> wrote:
> in meine crontab steht:
> 
> 08,23,38,53 * * * * mail if [ -x /usr/sbin/exim -a -f /etc/exim.conf ]; then /usr/sbin/exim -q >/dev/null 2>&1; fi
> 
> als Eintrag, damit der exim viertelstündlich die emails ausliefert (nehme ich an).

Ist das die /etc/crontab oder eine crontab eines users? Die
unterscheiden sich nämlich :)

> nun liefert dier crontab aber wie bekloppt (nämlich im viertelstundentakt folgende Fehler per Email:
> 
> /bin/sh: -c: line 1: syntax error near unexpected token `then'
> /bin/sh: -c: line 1: `mail if [ -x /usr/sbin/exim -a -f /etc/exim.conf ]; then /usr/sbin/exim -q >/dev/null 2>&1; fi'

Der Interpreter versucht offensichtlich, "mail" (mit einigen
Argumenten) auszuführen. Daher nehme ich an, daß das in einer user
crontab steht.

Laut "man 5 crontab":

       The format of a cron command is very much the V7 standard, with a  num‐
       ber  of upward-compatible extensions.  Each line has five time and date
       fields, followed by a command, followed by a newline character  (’\n’).
       The system crontab (/etc/crontab) uses the same format, except that the
       username for the command is specified after the time  and  date  fields
       and  before the command. The fields may be separated by spaces or tabs.

Also, wenn Du das Kommando als user "mail" starten willst, gehört das
in die /etc/crontab. Nur da wird der zusätzliche Username auch
ausgewertet.

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw at lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 für einen Freien Staat voll Freier Bürger"  | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lug-owl.de/pipermail/linux/attachments/20051122/87e93c6c/attachment.sig>


More information about the Linux mailing list