Hallo liebe Liste! vorweg genommen: ich habe nicht viel ahnung von mysql. ich versuche ein system zu pflegen, in welchem die mysql dumps jeden tag um 21 h laufen sollen. der untenstehende cronjob erledigt dies. zumindest denke ich das. anscheinend funktioniert hier jedoch einiges nicht. seit ein paar wochen gibt es keine dumps mehr. dieser job schreibt meiner meinung nach den dump in das verzeichnis /opt/lampp/backup/, hier erscheint jedoch nichts, auch nicht, wenn ich den befehl manuell ausführe. wo genau kann ich denn sehen, wo hier was falsch läuft? gibt es irgendwo ein logfile? ich wäre euch echt dankbar wenn ihr mir helfen könntet, denn der dump sollte möglichst schnell wieder funktionieren. 0 21 * * * date=`date -I`; /opt/lampp/bin/mysqldump backup -u root --password='passwort' | bzip2 -c > /opt/lampp/backup/backup-$date.sql.bz2 ^^^^^^^^^^^^^^^^ was bedeutet das?? vielen dank! Daniel
Hi Daniel,
0 21 * * * date=`date -I`; /opt/lampp/bin/mysqldump backup -u root --password='passwort' | bzip2 -c > /opt/lampp/backup/backup-$date.sql.bz2 ^^^^^^^^^^^^^^^^ was bedeutet das??
ist doch eigenlich lego was das bedeutet, um 21 uhr jeden Tag wird eine Variable date mit mit dem aktuellen Datum gefüllt, dann wird sqldump aufgefordert ein Backup zu machen. Der User der das angeblich macht ist root, mit dem passwort "passwort" ( hoffe nicht das das passwort von root wirklich "passwort" ist, was eindeutig unsicher wäre ). Das Backup soll durch bzip2 geleitet werden ( Komprimierung ) und soll unter /opt/lampp/backup/ zu finden sein als Datei mit dem Namen backup- $date.sql.bz2, wobei $date das aktuelle Datum ist zB 12012005. Wenn es so eine lange Zeit gelaufen hat, kann es vielleicht sein, das die Platte voll ist , hier würde es helfen, mal ganz alte Backups zu löschen. Vorab checken kannst du es mit "df -h". Oder Passwort von root geändert worden ist, bester test ist "ssh root@ipnummer des Servers". Crondamon noch läuft ? Hier testen mit "rccron status". Ausgeführte cron-jobs werden idR in der /var/log/messages geloggt. Desweiteren mal dieses und eventuell andere logfiles anschuen, ob um 21:00 jeden Tages Fehlermeldungen auflaufen. Die Ideen gehen mir so langsam aus, da die Kristallkugel nicht so richtig funktioniert ;-) Ansonsten , man bzip2 man date man cron weis nicht ob eine manpage von mysqldump vorhanden ist Martin
Moin, Am Mittwoch, den 12.01.2005, 08:47 +0100 schrieb Daniel Rudolph:
0 21 * * * date=`date -I`; /opt/lampp/bin/mysqldump backup -u root --password='passwort' | bzip2 -c > /opt/lampp/backup/backup-$date.sql.bz2 ^^^^^^^^^^^^^^^^ was bedeutet das??
Das bedeutet, dass das Ergebnis deines Mysql-Dumps durch bzip2 zum Komprimieren gepipt wird. Allerdings halte ich den Dump-Aufruf für falsch - oder heißt deine Database wirklich "backup"? Der richtige Aufruf müsste /opt/lampp/bin/mysqldump name_der_database [name_des_tables] sein, wobei ohne Angabe des tables die gesamte Database genommen wird. Diese Dump kannst du dann wie beschrieben komprimieren lassen und in einer Datei abspeichern... Martin
Hallo, Am Mittwoch, 12. Januar 2005 08:47 schrieb Daniel Rudolph:
Hallo liebe Liste! vorweg genommen: ich habe nicht viel ahnung von mysql. ich versuche ein system zu pflegen, in welchem die mysql dumps jeden tag um 21 h laufen sollen. der untenstehende cronjob erledigt dies. zumindest denke ich das. anscheinend funktioniert hier jedoch einiges nicht. seit ein paar wochen gibt es keine dumps mehr.
Hat sich irgendwas geändert?
dieser job schreibt meiner meinung nach den dump in das verzeichnis /opt/lampp/backup/, hier erscheint jedoch nichts, auch nicht, wenn ich den befehl manuell ausführe. wo genau kann ich denn sehen, wo hier was falsch läuft? gibt es irgendwo ein logfile? ich wäre euch echt dankbar wenn ihr mir helfen könntet, denn der dump sollte möglichst schnell wieder funktionieren.
0 21 * * * date=`date -I`; /opt/lampp/bin/mysqldump backup -u root --password='passwort' | bzip2 -c > /opt/lampp/backup/backup-$date.sql.bz2 ^^^^^^^^^^^^^^^^ was bedeutet das?? Je nach umbruch stehen die '^^^' wo anders !?? Ich vermute du fragst nach dem bzip2(?) Das Teil komprimiert den Datenstrom den mysqldump ausspuckt und schreibt das komprimierte Ergebnis nach ' >/opt/lampp...'
Beim bzip2 könnte auch das Problem liegen. Mach mal 'which bzip2' un schreib dann den vollen Pfad beim bzips dazu (bei mir: /usr/bin/bzip2). Wenns das nicht ist: probier den Befehl schrittweise von hand auszuführen: 1. /opt/lampp/bin/mysqldump backup -u root --password='passwort' > T1 steht in T1 was drin? wenn ja: 2, (Achtung eine Zeile!) /opt/lampp/bin/mysqldump backup -u root --password='pass..' | bzip2 -c > T2 steht in T2 was drin? wenn ja: 3. /opt/lampp/bin/mysqldump backup -u root --password='pass..' | bzip2 -c
/opt/lampp/backup/T3 steht in T3 was drin?
Sind Fehler aufgetreten (wann, welche,,)?
vielen dank!
Daniel
Viel Glück -- MfG Rolf Masfelder EMail: rolf.masfelder@nector.de
participants (4)
-
Daniel Rudolph
-
Hans-Martin Flesch
-
Martin hehnen
-
Rolf Masfelder