Hallo,
kannst du das vielleicht etwas weiter spezifizieren? Wie muss
ich das Skript konkret erweitern?
Ich bin erst am Beginn meiner „Linux Karriere“ und dies ist
mein erstes Skript, was ich per cron laufen lassen möchte.
Grüße,
Sebastian
Hi Sebastian,
bist du dir auch sicher, dass dein crontab-Eintrag richtig ist (dein 6. Feld ist roor??? - siehe Auszug aus ‚man crontab‘ unten)? Soll das Skript als root laufen (ggf. besser mit sudo arbeiten)?
Du könntest zuallererst mal versuchen, dass Script mit ‚ksh -x‘ zu starten, um zu sehen was funktioniert und welche Stellen als fehlerhaft angemeckert werden - also z.B. mit
ksh -x -c /backup/backupskript/backup.sh >:stuck\_out\_tongue\_winking\_eye:fad\_zur\_Logdatei 2\>&1
Wahrscheinlich steht dann im Log, dass einige der angesprochenen Programme (cp, chown, chmod?) nicht gefunden werden. Dann solltest du in deinem Skript zunaechst die PATH-Variable so setzen, dass diese Programme gefunden werden können (also mit export PATH=$PATH:smile:.
Wenn du nicht weiterkommst, poste mal die Logdatei-Ausgabe vom ksh -x.
gruss
bernhard
Auszug ‚man crontab‘ (Solaris)
A crontab file consists of lines of six fields each. The
fields are separated by spaces or tabs. The first five are
integer patterns that specify the following:
minute (0-59),
hour (0-23),
day of the month (1-31),
month of the year (1-12),
day of the week (0-6 with 0=Sunday).
The sixth field of a line in a crontab file is a string that
is executed by the shell at the specified times. A percent
character in this field (unless escaped by \) is translated
to a NEWLINE character.