<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    <br>
    zunächst tritt der Fehler nur auf, wenn weniger als 20 Zeilen
    kopiert werden. Sobald es 20 sind, ist alles schön. Ich hab mal
    testweise ein paar leere Gruppen erzeugt und plötzlich gab es keine
    Fehler beim Kopieren der Tabelle entities mehr.<br>
    <br>
    Allerdings hab ich jetzt einen zusätzlichen Fehler (Unable to load
    dynamic library, siehe unten), ne Idee, woher der kommen könnte?<br>
    <br>
    pi@raspberrypi ~ $ php
    /var/www/volkszaehler.org/misc/tools/dbcopy.php backup -c
    /var/www/volkszaehler.org/misc/tools/dbcopy.json -k<br>
    PHP Warning:  PHP Startup: Unable to load dynamic library
    '/usr/lib/php5/20131226/mcrypt.so' - libmcrypt.so.4: cannot open
    shared object file: Value too large for defined data type in Unknown
    on line 0<br>
    entities: copying 20 rows (overwrite)<br>
     [============================] 100%    1 sec/1 sec    20 rows<br>
    <br>
    properties: copying 149 rows (overwrite)<br>
     [============================] 100%    1 sec/1 sec    149 rows<br>
    <br>
    entities_in_aggregator: copying 4 rows (overwrite)<br>
     [>---------------------------]   0%    1 sec/1 sec    0 rowsPHP
    Warning:  Division by zero in
    /var/www/volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php
    on line 400<br>
    PHP Warning:  Division by zero in
    /var/www/volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php
    on line 401<br>
     [============================] 100%    1 sec/1 sec    4 rowsPHP
    Warning:  Division by zero in
    /var/www/volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php
    on line 400<br>
    PHP Warning:  Division by zero in
    /var/www/volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php
    on line 401<br>
     [============================] 100%    1 sec/1 sec    4 rows<br>
    <br>
    data: copying 40 rows (partial copy)<br>
     [============================] 100%    1 sec/1 sec    40 rows<br>
    <br>
    aggregate: skipping<br>
    pi@raspberrypi ~ $<br>
    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">Am 18.12.2015 um 09:56 schrieb Andreas
      Götz:<br>
    </div>
    <blockquote
      cite="mid:4D18810C-744F-4EF2-8AE2-84A83BE17609@gmail.com"
      type="cite">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <div>Hi Sirko,ä</div>
      <div>Ich seh im dump ld nicht wo der Fehler verursacht wird.
        Dürfte ich das bei Dir mal live per ssh anschauen?</div>
      <div><br>
      </div>
      <div>Danke und Gruß, Andreas </div>
      <div><br>
        Am 17.12.2015 um 14:30 schrieb Sirko <<a
          moz-do-not-send="true" href="mailto:mail_ist@nurfuerspam.de"><a class="moz-txt-link-abbreviated" href="mailto:mail_ist@nurfuerspam.de">mail_ist@nurfuerspam.de</a></a>>:<br>
        <br>
      </div>
      <blockquote type="cite">
        <div>
          <meta content="text/html; charset=utf-8"
            http-equiv="Content-Type">
          Hi Andreas,<br>
          <br>
          hat etwas gedauert, aber<br>
          <br>
          nach einem git pull scheint es eher noch schlimmer zu sein mit
          dem DivisionByZero:<br>
          <br>
          pi@raspberrypi ~ $ php /var/www/<a moz-do-not-send="true"
            href="http://volkszaehler.org/misc/tools/dbcopy.php">volkszaehler.org/misc/tools/dbcopy.php</a>
          backup -c /var/www/<a moz-do-not-send="true"
            href="http://volkszaehler.org/misc/tools/dbcopy.json">volkszaehler.org/misc/tools/dbcopy.json</a><br>
          entities: copying 14 rows (overwrite)<br>
           [>---------------------------]   0%    1 sec/1 sec     0
          rowsPHP Warning:  Division by zero in /var/www/<a
            moz-do-not-send="true"
href="http://volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php">volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php</a>
          on line 400<br>
          PHP Warning:  Division by zero in /var/www/<a
            moz-do-not-send="true"
href="http://volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php">volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php</a>
          on line 401<br>
           [============================] 100%    1 sec/1 sec    14
          rowsPHP Warning:  Division by zero in /var/www/<a
            moz-do-not-send="true"
href="http://volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php">volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php</a>
          on line 400<br>
          PHP Warning:  Division by zero in /var/www/<a
            moz-do-not-send="true"
href="http://volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php">volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php</a>
          on line 401<br>
           [============================] 100%    1 sec/1 sec    14 rows<br>
          <br>
          properties: copying 119 rows (overwrite)<br>
           [============================] 100%    1 sec/1 sec    119
          rows<br>
          <br>
          entities_in_aggregator: copying 4 rows (overwrite)<br>
           [>---------------------------]   0%    1 sec/1 sec    0
          rowsPHP Warning:  Division by zero in /var/www/<a
            moz-do-not-send="true"
href="http://volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php">volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php</a>
          on line 400<br>
          PHP Warning:  Division by zero in /var/www/<a
            moz-do-not-send="true"
href="http://volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php">volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php</a>
          on line 401<br>
           [============================] 100%    1 sec/1 sec    4
          rowsPHP Warning:  Division by zero in /var/www/<a
            moz-do-not-send="true"
href="http://volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php">volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php</a>
          on line 400<br>
          PHP Warning:  Division by zero in /var/www/<a
            moz-do-not-send="true"
href="http://volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php">volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php</a>
          on line 401<br>
           [============================] 100%    1 sec/1 sec    4 rows<br>
          <br>
          data: copying 56 rows (partial copy)<br>
           [============================] 100%    1 sec/1 sec    57 rows<br>
          <br>
          aggregate: skipping<br>
          <br>
          der -k Parameter scheint zu funktionieren.<br>
          Grüße<br>
          Sirko<br>
          <br>
          <br>
          <div class="moz-cite-prefix">Am 15.11.2015 um 11:41 schrieb
            Andreas Goetz:<br>
          </div>
          <blockquote
cite="mid:CAD+a8MgmVCPb5VZB-_SxwPs=Q4YbdzxnfDKD=bQAA0RnrYcesA@mail.gmail.com"
            type="cite">
            <div dir="ltr">Hallo Sirko,<br>
              <div class="gmail_extra"><br>
                <div class="gmail_quote">2015-10-29 9:54 GMT+01:00 Sirko
                  <span dir="ltr"><<a moz-do-not-send="true"
                      href="mailto:mail_ist@nurfuerspam.de"
                      target="_blank">mail_ist@nurfuerspam.de</a>></span>:<br>
                  <blockquote class="gmail_quote" style="margin:0 0 0
                    .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
                    <br>
                    ich nutze auch dbcopy, weil soweit ich weiß mit
                    mysqldump keine inkrementellen Backups gemacht
                    werden können.<br>
                    Allerdings waren die dbcopy-Sicherungen eher
                    unregelmäßig und so sind mir ca. 3 Wochen Daten
                    verloren gegangen, als meinem Raspi vor 2 Wochen der
                    endgültige SD-Tod ereilt hat.<br>
                    <br>
                    Bei mir läuft einfach auf meinem Desktop-Rechner ein
                    MySQL als Ziel-DB. Von dort hab ich dann einen Dump
                    gezogen und im Raspi importiert, um die DAten auf
                    einenr neuen SD wiederherzustellen.<br>
                    <br>
                    Als (hoffentlich in Zukunft täglich laufendes)
                    BackupScript hab ich einfach die Zeilen:<br>
                    <br>
                    #!/bin/bash<br>
                    #<br>
                    ##############<br>
                    # this script uses dbcopy <a moz-do-not-send="true"
                      href="https://github.com/andig/dbcopy"
                      rel="noreferrer" target="_blank">https://github.com/andig/dbcopy</a><br>
                    # to incrementally backup volkszaehler data to
                    another<br>
                    # database<br>
                    #<br>
                    #<br>
                    ##############<br>
                    <br>
                    # test for running mysql-DB<br>
                    connection_error=`nc -z -w5 192.168.178.99 3306;echo
                    $?`<br>
                    #echo $connection_error<br>
                    <br>
                    if [ $connection_error -gt 0 ]<br>
                            then<br>
                                    echo "DB is down, exiting"<br>
                            else<br>
                                    sudo php /var/www/<a
                      moz-do-not-send="true"
                      href="http://volkszaehler.org/misc/tools/dbcopy.php"
                      rel="noreferrer" target="_blank">volkszaehler.org/misc/tools/dbcopy.php</a>
                    backup -c /var/www/<a moz-do-not-send="true"
                      href="http://volkszaehler.org/misc/tools/dbcopy.json"
                      rel="noreferrer" target="_blank">volkszaehler.org/misc/tools/dbcopy.json</a><br>
                    <br>
                    fi<br>
                    <br>
                    192.168.178.99 ist dabei die IP meines
                    Desktop-Rechners, die /var/www/<a
                      moz-do-not-send="true"
                      href="http://volkszaehler.org/misc/tools/dbcopy.jsonmu%C3%9F"
                      rel="noreferrer" target="_blank">volkszaehler.org/misc/tools/dbcopy.jsonmuß</a>
                    natürlich auch richtig konfiguriert werden.<br>
                    <br>
                    Als Rückmeldung an Andreas: was mir immer auffällt
                    (aber keine Probleme macht), sind die "Division by
                    zero" Meldungen:<br>
                    pi@raspberrypi ~ $ bin/incremental_db_backup.sh<br>
                    ...<br>
                    entities_in_aggregator: copying 0 rows (overwrite)<br>
                        0 [>---------------------------]PHP Warning:
                    Division by zero in /var/www/<a
                      moz-do-not-send="true"
href="http://volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php"
                      rel="noreferrer" target="_blank">volkszaehler.org/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressBar.php</a>
                    on line 400<br>
                  </blockquote>
                  <br>
                </div>
                <div class="gmail_quote">Der Fehler sollte jetzt behoben
                  sein, könntest Du das verifizieren?<br>
                  <br>
                </div>
                <div class="gmail_quote">
                  <blockquote class="gmail_quote" style="margin:0 0 0
                    .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br>
                    Allerdings hab ich einen Feature-Request. ...<br>
                    <br>
                    Jetzt zum Feature-Request: ich mußte im dbcopy
                    rumpfuschen, damit es mir auf dem Raspi nicht die
                    FKs droppt, weil das Erstellen derselben nach dem
                    dbcopy wieder ewig gedauert hätte.<br>
                  </blockquote>
                  <div><br>
                  </div>
                  <div>Guter Punkt. Im Moment ist das nötig weil nicht
                    in logischen Einheiten sondern tabellenweise kopiert
                    wird. Um die Entities zu kopieren müssen vorher die
                    Properties stimmen (sonst fehlender Foreign Key) und
                    umgekehrt. Das geht nur wenn die FKs weg sind oder
                    sich an diesen Tabellen nichts ändert das zu einer
                    FK Violation führen würde. <br>
                    <br>
                    Per Code kann ich das nicht abfangen.<br>
                     <br>
                  </div>
                  <blockquote class="gmail_quote" style="margin:0 0 0
                    .8ex;border-left:1px #ccc solid;padding-left:1ex">
                    Ich hätte daher gern einen Schalter am dbcopy, mit
                    welchem man das Droppen der FKs unterbinden kann.
                    Wäre das möglich, Andreas?<br>
                  </blockquote>
                  <div><br>
                  </div>
                  <div>Es gibt zwei Möglichkeiten: entweder eine Option
                    die das verhindert (einfach genug) oder Du probierst
                    mal ob Dir das droppen nicht reicht. Die FKs sind
                    zwar "schön" aber eigentlich nicht notwendig da sich
                    VZ um korrekte Integrität kümmert.<br>
                     <br>
                  </div>
                  <blockquote class="gmail_quote" style="margin:0 0 0
                    .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br>
                    Grüße<span class="HOEnZb"><font color="#888888"><br>
                        Sirko</font></span>
                    <div class="HOEnZb">
                      <div class="h5"><br>
                      </div>
                    </div>
                  </blockquote>
                  <div><br>
                  </div>
                  <div>Viele Grüße,<br>
                  </div>
                  <div>Andreas<br>
                     <br>
                  </div>
                  <blockquote class="gmail_quote" style="margin:0 0 0
                    .8ex;border-left:1px #ccc solid;padding-left:1ex">
                    <div class="HOEnZb">
                      <div class="h5"> <br>
                        Am 29.10.2015 um 08:11 schrieb Andreas Götz:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex"> Hi Daniel,<br>
                          <br>
                          Funktioniert dbcopy für Dich? Hab wenig
                          Rückmeldung bekommen...<br>
                          <br>
                          Viele Grüße, Andreas<br>
                          <br>
                          <br>
                          <blockquote class="gmail_quote"
                            style="margin:0 0 0 .8ex;border-left:1px
                            #ccc solid;padding-left:1ex"> Am 29.10.2015
                            um 07:43 schrieb Daniel Lauckner <<a
                              moz-do-not-send="true"
                              href="mailto:mailing@jahp.de"
                              target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:mailing@jahp.de">mailing@jahp.de</a></a>>:<br>
                            <br>
                            <blockquote class="gmail_quote"
                              style="margin:0 0 0 .8ex;border-left:1px
                              #ccc solid;padding-left:1ex"> Am Dienstag,
                              27. Oktober 2015 um 22:37 schrieb Theo:<br>
                              Darf ich fragen welches php Script
                              mysql-backup du verwendest?<br>
                            </blockquote>
                            ~/bin/mysql-backup<br>
                            Liegt im aktuellen Image hoffentlich noch an
                            der selben Stelle.<br>
                            <br>
                            <blockquote class="gmail_quote"
                              style="margin:0 0 0 .8ex;border-left:1px
                              #ccc solid;padding-left:1ex"> Würde nicht
                              ein einfaches per cron job gestartetes
                              Shell<br>
                              script in dem mysqldump ausgeführt wird
                              reichen?<br>
                            </blockquote>
                            Ja.<br>
                            <br>
                            <blockquote class="gmail_quote"
                              style="margin:0 0 0 .8ex;border-left:1px
                              #ccc solid;padding-left:1ex"> Oder liegt
                              das<br>
                              daran das ich damit immer nur ein und die
                              selbe Sicherungsdatei<br>
                              erstelle und somit immer nur das letzte
                              Backup zur Verfügung habe?<br>
                            </blockquote>
                            Das php-Script erstellt eine neue Datei mit
                            Datum im Namen.<br>
                            <br>
                            Schönheitsfehler vom mysqldump auf dem Raspi
                            ist halt das es die<br>
                            Datenbank zu sehr stresst und in Folge der
                            vzlogger aus dem<br>
                            Tritt kommt.<br>
                            <br>
                            Deswegen mein Wechsel zu dbcopy.<br>
                            <br>
                            <blockquote class="gmail_quote"
                              style="margin:0 0 0 .8ex;border-left:1px
                              #ccc solid;padding-left:1ex"> Ich habe
                              hier <a moz-do-not-send="true"
                                class="moz-txt-link-freetext"
                                href="https://wiki.ubuntuusers.de/MySQL/Backup">https://wiki.ubuntuusers.de/MySQL/Backup</a>
                              [...]<br>
                              etwas gefunden, da wird ganz<br>
                              unten auch ein script vorgestellt mit dem
                              man auch inkrementelle<br>
                              Sicherungen anfertigen kann.<br>
                            </blockquote>
                            Ob bzr eine Alternative ist kann ich leider
                            nicht einschätzen.<br>
                            <br>
                            <br>
                            <blockquote class="gmail_quote"
                              style="margin:0 0 0 .8ex;border-left:1px
                              #ccc solid;padding-left:1ex"> Mir geht es
                              darum ob das prinzipiell der richtige Weg
                              ist.<br>
                            </blockquote>
                            Regelmäßige inkrementelle Sicherung und
                            gelegentlicher Vollabzug<br>
                            der DB ist fast schon das Optimum.<br>
                            <br>
                            <br>
                            mfg Daniel<br>
                            <br>
                            <br>
                            ---<br>
                            Diese E-Mail wurde von Avast
                            Antivirus-Software auf Viren geprüft.<br>
                            <a moz-do-not-send="true"
                              href="https://www.avast.com/antivirus"
                              rel="noreferrer" target="_blank">https://www.avast.com/antivirus</a><br>
                            <br>
                          </blockquote>
                        </blockquote>
                        <br>
                      </div>
                    </div>
                  </blockquote>
                </div>
                <br>
              </div>
            </div>
          </blockquote>
          <br>
        </div>
      </blockquote>
    </blockquote>
    <br>
  </body>
</html>