Modul 93_DbRep - Reporting und Management von Datenbankinhalten (DbLog)

Begonnen von DS_Starter, 19 Mai 2016, 22:52:13

Vorheriges Thema - Nächstes Thema

dk3572

das gibt es so nicht

attr Rep.tempSQLITE DbRep expimpfile export.csv

nur ohne DbRep

DS_Starter

#1156
Ja natürlich, ich hab zu schnell geschrieben  ???

attr Rep.tempSQLITE expimpfile export.csv

Edit: Habe die Anleitung weiter vorne gleich noch korrigiert.
Proxmox+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

dk3572


DS_Starter

Ja. Du kannst ja vorher nochmal dein Rep.tempSQLITE anschauen.
Dort muss nun das Attribut

expimpfile  = export.csv

gesetzt sein. Das benutzt der Export dann.

Du kannst ja vllt. noch ein fetchrows ausführen und mir dann ein list zeigen wenn es nicht zu groß ist. Dann sehe ich ob das attr drin ist.
Proxmox+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

dk3572

/ -- / -- -- ROWS EXPORTED TO FILE(S) --     1753049     2020-05-19 16:17:58


Datei vorhanden

DS_Starter

sehr gut :)

So aufpassen, jetzt gehen wir in dein gestern angelegtes Rep.SQLite.Backup  und machen ein dumpSQLite wie gestern geübt.

Wenn das fertig ist, setzt du in diesem Rep auch das Attribut expimpfile für den Import:

attr Rep.SQLite.Backup expimpfile export.csv

Dann kommt der Import dran mit

set Rep.SQLite.Backup importFromFile
Proxmox+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

dk3572

Ich bin beeindruckt welche Geduld du mit mir aufbringst. Danke.
Leider muss ich ein kleine Pause einlegen.
Muss was erledigen.
Melde mich später wieder.....

DS_Starter

Das Thema ist nicht ganz trivial für User die sich nicht ständig damit beschäftigen, da kann man niemanden alleine sterben lassen.
Außerdem macht diese Problemlösung Spaß und glücklicherweise habe ich etwas Zeit.  :)
Proxmox+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

dk3572

2020.05.19 16:54:10.909 3: DbRep Rep.SQLite.Backup - ################################################################
2020.05.19 16:54:10.910 3: DbRep Rep.SQLite.Backup - ###                    New SQLite dump                       ###
2020.05.19 16:54:10.910 3: DbRep Rep.SQLite.Backup - ################################################################
2020.05.19 16:54:10.910 3: DbRep Rep.SQLite.Backup - execute command before dump: 'set logdb reopen 3600'
2020.05.19 16:54:11.015 3: DbRep Rep.SQLite.Backup - Size of database /opt/fhem/fhem.db before optimize (MB): 522
2020.05.19 16:54:11.016 3: DbRep Rep.SQLite.Backup - VACUUM database /opt/fhem/fhem.db....
2020.05.19 16:54:22.541 3: DbRep Rep.SQLite.Backup - Size of database /opt/fhem/fhem.db after optimize (MB): 513
2020.05.19 16:54:22.542 3: DbRep Rep.SQLite.Backup - Starting dump of database 'fhem.db'
2020.05.19 16:54:26.570 3: DbRep Rep.SQLite.Backup - Size of backupfile: 512.74 MB
2020.05.19 16:54:26.573 3: DbRep Rep.SQLite.Backup - Finished backup of database fhem - total time used (hh:mm:ss): 00:00:15
2020.05.19 16:54:26.588 2: DbRep Rep.SQLite.Backup - command message after dump: "Reopen executed."
2020.05.19 16:54:26.600 3: DbRep Rep.SQLite.Backup - Database dump finished successfully.


Attribut gesetzt.

Woher weiß das DbRep Rep.SQLite.Backup welche Datei bzw. wo sie liegt?

CFGFN     
   DATABASE   /opt/fhem/fhem.db
   DEF        logdb
   FUUID      5ec2c4f7-f33f-cd72-91f5-f58c6964ed304ce0
   FVERSION   93_DbRep.pm:v8.40.0-s21546/2020-03-30
   LASTCMD    dumpSQLite
   MODEL      Client
   NAME       Rep.SQLite.Backup
   NOTIFYDEV  global,Rep.SQLite.Backup
   NR         40732
   NTFY_ORDER 50-Rep.SQLite.Backup
   ROLE       Client
   STATE      Warning - dump finished, but command message after dump appeared
   TYPE       DbRep
   UTF8       0
   HELPER:
     DBLOGDEVICE logdb
     IDRETRIES  3
     MINTS      2020-04-13 21:54:39
     PACKAGE    main
     VERSION    8.40.0
     DBREPCOL:
       COLSET     1
       DEVICE     64
       EVENT      512
       READING    64
       TYPE       64
       UNIT       32
       VALUE      128
   Helper:
     DBLOG:
       state:
         logdb:
           TIME       1589900066.59703
           VALUE      Warning - dump finished, but command message after dump appeared
   OLDREADINGS:
   READINGS:
     2020-05-19 16:54:26   DumpFileCreated ./log/fhem_2020_05_19_16_54.sqlitebkp
     2020-05-19 16:54:26   DumpFileCreatedSize 512.74 MB
     2020-05-19 16:54:26   DumpRowsCurrent n.a.
     2020-05-19 16:54:26   DumpRowsHistory n.a.
     2020-05-19 16:54:26   afterdump_message Reopen executed.
     2020-05-19 16:54:26   background_processing_time 15.5753
     2020-05-19 16:54:26   state           Warning - dump finished, but command message after dump appeared
Attributes:
   devStateIcon connected:10px-kreis-gelb .*disconnect:10px-kreis-rot .*done:10px-kreis-gruen
   dumpDirLocal ./log
   dumpFilesKeep 3
   event-on-update-reading state
   executeAfterProc set logdb reopen
   executeBeforeProc set logdb reopen 3600
   expimpfile export.csv
   fastStart  1
   optimizeTablesBeforeDump 1
   room       Photovoltaik
   showproctime 1
   verbose    3

DS_Starter

ZitatWoher weiß das DbRep Rep.SQLite.Backup welche Datei bzw. wo sie liegt?

Aus dem gesetzten Attribut expimpfile. Wenn kein Pfad dabei steht nimmt das Rep den eingebauten Standard und sollte es finden. Man kann natürlich auch einen Pfad mit angeben.

Na dann ...
Proxmox+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

dk3572

-- ROWS IMPORTED FROM FILE --    1753049


....muss leider schon wieder Pause einlegen.....

DS_Starter

Jo, so soll es sein.

Jetzt machst du wieder ein Backup mit dumpSQLite. Wenn das durch ist haben wir erstmal den Datenbestand gerettet und gesichert.
Dann kümmern wir uns um den Rest.
Proxmox+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

dk3572


DS_Starter

Ja, sichern immer mit diesem Teil. Das benutzt du jetzt quasi immer und regelmäßig ! für ein Datenbank-Backup (mit at oder so)
Proxmox+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

dk3572

2020.05.19 17:16:15.421 3: DbRep Rep.SQLite.Backup - ################################################################
2020.05.19 17:16:15.421 3: DbRep Rep.SQLite.Backup - ###                    New SQLite dump                       ###
2020.05.19 17:16:15.421 3: DbRep Rep.SQLite.Backup - ################################################################
2020.05.19 17:16:15.421 3: DbRep Rep.SQLite.Backup - execute command before dump: 'set logdb reopen 3600'
2020.05.19 17:16:15.511 3: DbRep Rep.SQLite.Backup - Size of database /opt/fhem/fhem.db before optimize (MB): 868
2020.05.19 17:16:15.511 3: DbRep Rep.SQLite.Backup - VACUUM database /opt/fhem/fhem.db....
2020.05.19 17:16:35.614 3: DbRep Rep.SQLite.Backup - Size of database /opt/fhem/fhem.db after optimize (MB): 853
2020.05.19 17:16:35.615 3: DbRep Rep.SQLite.Backup - Starting dump of database 'fhem.db'
2020.05.19 17:16:42.952 3: DbRep Rep.SQLite.Backup - Size of backupfile: 852.34 MB
2020.05.19 17:16:42.954 3: DbRep Rep.SQLite.Backup - Deleting old dumpfile 'fhem_2020_05_18_20_05.sqlitebkp'
2020.05.19 17:16:42.956 3: DbRep Rep.SQLite.Backup - Finished backup of database fhem - total time used (hh:mm:ss): 00:00:27
2020.05.19 17:16:42.973 2: DbRep Rep.SQLite.Backup - command message after dump: "Reopen executed."
2020.05.19 17:16:43.006 3: DbRep Rep.SQLite.Backup - Database dump finished successfully.