[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: crontab: zwei Befehle in einer Zeile möglich?



Moinmoin,

On Wed, Mar 25, 2009 at 01:45:59PM +0000, Thomas Fugmann wrote:
> ist es eigentlich möglich, in der crontab-Datei zwei Kommandos in eine
> Zeile zu schreiben???
> Kann mir jemand einen Tipp geben?

Ja, es ist möglich, und Du warst auch schon auf dem richtigen Weg, aber

> Diese Versuche waren erfolglos:
> 
> */10 * * * * ( /bin/date '+%T' ; /bin/ping -c 1 host )   >>/tmp/pingtest 2>&1
> 
> */10 * * * *  /bin/date '+%T'   >>/tmp/pingtest  ; /bin/ping -c 1 host  >>/tmp/pingtest 2>&1

das "%" hat im Kontext einer crontab-Datei eine besondere Bedeutung,
siehe "man 5 crontab | grep '%'". Einfach "\%" berücksichtigen und gut.

Cheers,
Flo

Attachment: signature.asc
Description: Digital signature


Reply to: