[98_backupToStorage] Modul zum upload des FHEM Backups auf ein Storage

Begonnen von CoolTux, 18 Juni 2020, 13:14:42

Vorheriges Thema - Nächstes Thema

DS_Starter

@Marco

ZitatDann werde ich erstmal schauen das ich ftp  ...

Im DbRep habe ich schon eine Routine drin die (S)FTP mit einigen Einstellmöglichkeiten und einer Versionsverwaltung macht:


FTP Transfer nach Dump
Wenn diese Möglichkeit genutzt werden soll, ist das Attribut "ftpUse" oder "ftpUseSSL" zu setzen. Letzteres gilt wenn eine verschlüsselte Übertragung genutzt werden soll.
Das Modul übernimmt ebenfalls die Versionierung der Dumpfiles im FTP-Zielverzeichnis mit Hilfe des Attributes "ftpDumpFilesKeep". Für die FTP-Übertragung relevante Attribute sind:

    ftpUse : FTP Transfer nach dem Dump wird eingeschaltet (ohne SSL Verschlüsselung)
    ftpUser : User zur Anmeldung am FTP-Server, default: anonymous
    ftpUseSSL : FTP Transfer mit SSL Verschlüsselung nach dem Dump wird eingeschaltet
    ftpDebug : Debugging des FTP Verkehrs zur Fehlersuche
    ftpDir : Verzeichnis auf dem FTP-Server in welches das File übertragen werden soll (default: "/")
    ftpDumpFilesKeep : Es wird die angegebene Anzahl Dumpfiles im <ftpDir> belassen (default: 3)
    ftpPassive : setzen wenn passives FTP verwendet werden soll
    ftpPort : FTP-Port, default: 21
    ftpPwd : Passwort des FTP-Users, default nicht gesetzt
    ftpServer : Name oder IP-Adresse des FTP-Servers. notwendig !
    ftpTimeout : Timeout für die FTP-Verbindung in Sekunden (default: 30).


Einstieg ist die sub DbRep_sendftp. Ist zwar schon etwas angegraut, aber tut was es soll und vllt. kannst du etwas davon gebrauchen.

LG,
Heiko
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

CoolTux

Vielen Dank,

Das schaue ich mir gerne an. Eventuell können wir daraus auch eine lib machen. mal sehen.



Grüße
Marko
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

tomspatz

Ich bekomme:
Unknown module backupToStorage
wenn ich das Modul probier anzulegen

MadMax-FHEM

#33
Zitat von: tomspatz am 17 Oktober 2020, 13:56:13
Ich bekomme:
Unknown module backupToStorage
wenn ich das Modul probier anzulegen

https://forum.fhem.de/index.php/topic,112216.msg1065438.html#msg1065438

Hast du gelesen!?

EDIT: der Thread ist doch noch nicht sooo lang, da kann/sollte man sich doch (noch) durchlesen können... Und wo fängt man da an!? Am Anfang... ;)

Ist ([verm.] noch) nicht im offiziellen update...

Gruß, Joachim
FHEM PI3B+ Bullseye: HM-CFG-USB, 40x HM, ZWave-USB, 13x ZWave, EnOcean-PI, 15x EnOcean, HUE/deCONZ, CO2, ESP-Multisensor, Shelly, alexa-fhem, ...
FHEM PI2 Buster: HM-CFG-USB, 25x HM, ZWave-USB, 4x ZWave, EnOcean-PI, 3x EnOcean, Shelly, ha-bridge, ...
FHEM PI3 Buster (Test)

DS_Starter

Hallo Marco, @Synology User,

ich bin momentan dabei ein Modul SSFile für die Integration der Synology File Station zu erstellen. Hatte ich in #26 ja angedeutet. Es sind schon einige Funktionen implementiert, z.b. klappt der Download problemlos. Der Upload ist etwas aufwändiger und da habe noch eine Hängephase.  ;)

Wenn ich soweit bin, mache ich einen entsprechenden Thread auf. Jedenfalls tut sich etwas und damit rückt auch eine mögliche Integration in backupToStorage rückt etwas näher.

Grüße,
Heiko
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

tomspatz

ha ha ha
ja habe ich gelesen, selbst der UpdateCheck sagt:
Downloading https://fhem.de/fhemupdate/controls_fhem.txt

fhem
nothing to do...
Downloading https://git.cooltux.net/FHEM/mod-backupToStorage/raw/branch/testing/controls_backupToStorage.txt

backupToStorage
nothing to do...


Im Log finde ich allerdings:
2020.10.17 14:33:00 1: PERL WARNING: Subroutine backupToStorage_Initialize redefined at ./FHEM/98_backupToStorage.pm line 40.
2020.10.17 14:33:00 0: Undefined subroutine &FHEM::Meta::InitMod called at ./FHEM/98_backupToStorage.pm line 60.

CoolTux

Zitat von: tomspatz am 17 Oktober 2020, 14:36:03
ha ha ha
ja habe ich gelesen, selbst der UpdateCheck sagt:
Downloading https://fhem.de/fhemupdate/controls_fhem.txt

fhem
nothing to do...
Downloading https://git.cooltux.net/FHEM/mod-backupToStorage/raw/branch/testing/controls_backupToStorage.txt

backupToStorage
nothing to do...


Im Log finde ich allerdings:
2020.10.17 14:33:00 1: PERL WARNING: Subroutine backupToStorage_Initialize redefined at ./FHEM/98_backupToStorage.pm line 40.
2020.10.17 14:33:00 0: Undefined subroutine &FHEM::Meta::InitMod called at ./FHEM/98_backupToStorage.pm line 60.


Schau mal bitte ob Du die Meta.pm Datei unter /opt/fhem/FHEM/ finden kannst.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

MadMax-FHEM

Zitat von: tomspatz am 17 Oktober 2020, 14:36:03
ha ha ha
ja habe ich gelesen, selbst der UpdateCheck sagt:
Downloading https://fhem.de/fhemupdate/controls_fhem.txt

fhem
nothing to do...
Downloading https://git.cooltux.net/FHEM/mod-backupToStorage/raw/branch/testing/controls_backupToStorage.txt

backupToStorage
nothing to do...


Im Log finde ich allerdings:
2020.10.17 14:33:00 1: PERL WARNING: Subroutine backupToStorage_Initialize redefined at ./FHEM/98_backupToStorage.pm line 40.
2020.10.17 14:33:00 0: Undefined subroutine &FHEM::Meta::InitMod called at ./FHEM/98_backupToStorage.pm line 60.


Was heißt hier: hahaha...

Mit den gelieferten (oder eher NICHT gelieferten) Infos ist es ja wohl mal plausibel zu fragen, ob du das gelesen hast...

Viel Spaß noch, Joachim
FHEM PI3B+ Bullseye: HM-CFG-USB, 40x HM, ZWave-USB, 13x ZWave, EnOcean-PI, 15x EnOcean, HUE/deCONZ, CO2, ESP-Multisensor, Shelly, alexa-fhem, ...
FHEM PI2 Buster: HM-CFG-USB, 25x HM, ZWave-USB, 4x ZWave, EnOcean-PI, 3x EnOcean, Shelly, ha-bridge, ...
FHEM PI3 Buster (Test)

tomspatz

Hey Joachim alles locker  ;)
@CoolTux
ja Meta.pm ist in dem Verzeichnis vorhanden.

CoolTux

Versuch mal in fhemweb ein reload Meta.pm und schau dann ins Log was da steht.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

tomspatz

im log kommt nichts aber im web erscheint sofort:
Undefined subroutine &main::Meta_Initialize called at fhem.pl line 2661.

CoolTux

Du hast doch dein FHEM System er neulich von einer 2018er Version aktualisiert oder?
Ich befürchte das da irgendwas noch fehlt. Weiß aber nicht was.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

tomspatz

Moin
jain, das System auf dem ich das backupToStorage Modul teste ist NICHT mein produktiv System.
Das ist tatsächlich mist neu ganz frisch buster auf Raspi und aktuellstes fhem.

CoolTux

Kannst Du mal die Datei /opt/fhem/FHEM/98_backupToStorage.pm mit einem Editor öffnen und in Zeile 37 unter

use utf8;

ein

use Meta;

einfügen. Danach Neustart und das define noch mal probieren.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

tomspatz

OK damit lässt sich zumindest das Modul in Betrieb nehmen. Allerdings beim ausführen des Backups, direkt nach neustart kommt:
2020.10.18 18:17:18 0: Featurelevel: 6
2020.10.18 18:17:18 0: Server started with 12 defined entities (fhem.pl:22935/2020-10-07 perl:5.028001 os:linux user:fhem pid:6215)
2020.10.18 18:19:07 1: PERL WARNING: Subroutine import redefined at FHEM/Meta.pm line 654.
2020.10.18 18:19:07 1: PERL WARNING: Subroutine InitMod redefined at FHEM/Meta.pm line 670.
2020.10.18 18:19:07 1: PERL WARNING: Subroutine Load redefined at FHEM/Meta.pm line 706.
2020.10.18 18:19:07 1: PERL WARNING: Subroutine SetInternals redefined at FHEM/Meta.pm line 878.
2020.10.18 18:19:07 1: PERL WARNING: Subroutine Get redefined at FHEM/Meta.pm line 901.
2020.10.18 18:19:07 1: PERL WARNING: Subroutine GetModuleSourceOrigin redefined at FHEM/Meta.pm line 919.
2020.10.18 18:19:07 1: PERL WARNING: Subroutine GetKeywordDesc redefined at FHEM/Meta.pm line 940.
2020.10.18 18:19:07 1: PERL WARNING: Subroutine ModuleIsCore redefined at FHEM/Meta.pm line 956.
2020.10.18 18:19:07 1: PERL WARNING: Subroutine ModuleIsInternal redefined at FHEM/Meta.pm line 961.
2020.10.18 18:19:07 1: PERL WARNING: Subroutine GetModuleFilepath redefined at FHEM/Meta.pm line 993.
2020.10.18 18:19:07 1: PERL WARNING: Subroutine ModuleIsPerlCore redefined at FHEM/Meta.pm line 1049.
2020.10.18 18:19:07 1: PERL WARNING: Subroutine __CopyMetaToInternals redefined at FHEM/Meta.pm line 1085.
2020.10.18 18:19:07 1: PERL WARNING: Subroutine __PutMetadata redefined at FHEM/Meta.pm line 1096.
2020.10.18 18:19:07 1: PERL WARNING: Subroutine __GetMetadata redefined at FHEM/Meta.pm line 1121.
2020.10.18 18:19:07 1: PERL WARNING: Subroutine __GenerateKeywordsFromSupportCommunity redefined at FHEM/Meta.pm line 2426.
2020.10.18 18:19:07 1: PERL WARNING: Subroutine __GetPackages redefined at FHEM/Meta.pm line 2521.
2020.10.18 18:19:07 1: PERL WARNING: Subroutine __GetMaintainerdata redefined at FHEM/Meta.pm line 2556.
2020.10.18 18:19:07 1: PERL WARNING: Subroutine __GetSupportForum redefined at FHEM/Meta.pm line 2770.
2020.10.18 18:19:07 1: PERL WARNING: Subroutine __GetUpdatedata redefined at FHEM/Meta.pm line 2956.
2020.10.18 18:19:07 1: PERL WARNING: Subroutine __SetXVersion redefined at FHEM/Meta.pm line 3206.
2020.10.18 18:19:08 2: backup include:
2020.10.18 18:19:08 2: backup include:
2020.10.18 18:19:08 2: Backup with command: tar czf ./backup/FHEM-20201018_181908.tar.gz "./fhem.pl" "./restoreDir" "./MAINTAINER.txt" "./FHEM" "./contrib" "./log" "./README_DEMO.txt" "./lib" "./docs" "./www" "./fhem.cfg" "./demolog" "./configDB.pm" "./fhem.cfg.demo" "./CHANGED"
2020.10.18 18:19:08 3: telnetForBlockingFn_1603037948: port 44687 opened
Backup done

es wird auch nichts in die cloud geschrieben.