[Eisfair_dev] [E1] Einrichten eines Cronjobs "@reboot"

Marcus Roeckrath marcus.roeckrath at gmx.de
Mo Jun 20 15:14:25 CEST 2016


Hallo Helmut,

Helmut Backhaus wrote:

>>> Jetzt habe ich ihn wie folgt geändert, in der Hoffnung damit weiter zu
>>> kommen:
>>> @reboot sleep 30 && /var/install/bin/update-chk01.sh
>>
>> Das ist korrekt so.
> 
> OK, super dass war einfach ein Schuss ins blaue!
> 
>>
>> Ich habe es gerade mal getestet und
>>
>> @reboot command1
>>
>> oder
>>
>> @reboot command1 && command2
>>
>> haben beim Reboot klaglos funktioniert.
>>
> 
> Einmal Rebootet oder mehrfach?

Zuerst mit "@reboot kommando" und reboot:

Hier wird er gestartet:

Jun 20 13:52:01 eis fcron[32575]: Job 'echo "crontest" > /tmp/crontest'
started for user root (pid 32584)
Jun 20 13:52:01 eis fcron[1865]: Line 'echo "crontest" > /tmp/crontest' has
runonce set: not re-scheduling it.

Hier ist er fertig:

Jun 20 13:52:03 eis fcron[32575]: Job 'echo "crontest" > /tmp/crontest'
completed

Hier kommen jetzt die Hinweise, dass der Job nicht nochmal gestartet wird:

Jun 20 13:52:12 eis fcron[1865]:   from last conf: job 'echo "crontest"
> /tmp/crontest' with runonce set has already run since last system
startup: not re-scheduling.
Jun 20 13:52:12 eis fcron[1865]:   from last conf: job 'echo "crontest"
> /tmp/crontest' with runonce set has already run since last system
startup: not re-scheduling.
Jun 20 13:55:18 eis fcron[2363]: Job 'echo "crontest" > /tmp/crontest'
started for user root (pid 2373)
Jun 20 13:55:18 eis fcron[1865]: Line 'echo "crontest" > /tmp/crontest' has
runonce set: not re-scheduling it.
Jun 20 13:55:20 eis fcron[2363]: Job 'echo "crontest" > /tmp/crontest'
completed
Jun 20 13:56:35 eis fcron[1865]:   from last conf: job 'echo "crontest"
> /tmp/crontest' with runonce set has already run since last system
startup: not re-scheduling.
Jun 20 13:56:37 eis fcron[1865]:   from last conf: job 'echo "crontest"
> /tmp/crontest' with runonce set has already run since last system
startup: not re-scheduling.
Jun 20 13:58:41 eis fcron[6623]: Job 'sleep 30 && echo "crontest"
> /tmp/crontest' started for user root (pid 6632)
Jun 20 13:58:41 eis fcron[1865]: Line 'sleep 30 && echo "crontest"
> /tmp/crontest' has runonce set: not re-scheduling it.
Jun 20 13:58:46 eis fcron[1865]:   from last conf: job 'sleep 30 && echo
"crontest" > /tmp/crontest' with runonce set has already run since last
system startup: not re-scheduling.
Jun 20 13:58:46 eis fcron[1865]:   from last conf: job 'sleep 30 && echo
"crontest" > /tmp/crontest' with runonce set has already run since last
system startup: not re-scheduling.

Nun mit "@reboot kommando1 && kommando2" und dann reboot:

Hier wird der Job gestartet:

Jun 20 14:01:46 eis fcron[2363]: Job 'sleep 30 && echo "crontest"
> /tmp/crontest' started for user root (pid 2372)
Jun 20 14:01:46 eis fcron[1864]: Line 'sleep 30 && echo "crontest"
> /tmp/crontest' has runonce set: not re-scheduling it.

Hier ist er fertig:

Jun 20 14:02:18 eis fcron[2363]: Job 'sleep 30 && echo "crontest"
> /tmp/crontest' completed

Und wieder die Hinweise:

Jun 20 14:02:56 eis fcron[1864]:   from last conf: job 'sleep 30 && echo
"crontest" > /tmp/crontest' with runonce set has already run since last
system startup: not re-scheduling.
Jun 20 14:02:58 eis fcron[1864]:   from last conf: job 'sleep 30 && echo
"crontest" > /tmp/crontest' with runonce set has already run since last
system startup: not re-scheduling.

Die Hinweise sind nicht das Problem.

> Oder liegt mein Problem darin, dass das ganze beim ersten mal schief
> gegangen ist?

Da muss ich drüber nachdenken.

Du hastest update-chk01.sh schon als normalen cronjob laufen oder bislang
immer nur manuell?

Vielleicht ist da noch etwas drin, was zwar an der Konsole aber nicht in der
Umgebung von fcron funktioniert.

Kandidaten für solche Fehler sind Kommandos, die nicht im Pfad von fcron
liegen.

fcron findet nur Befehle die in /bin und /usr/bin liegen. Liegt ein Befehl
woanders, muss dieser mit vollem Pfad angegeben werden.

In erster Durchsicht fällt mir da jetzt aber nichts ins Auge; schaue nochmal
Zeile für Zeile nach.

-- 
Gruss Marcus


Mehr Informationen über die Mailingliste Eisfair_dev