[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

CoolTux

Zitat von: ErzGabriel am 14 März 2021, 08:33:23
Hi CoolTux.
Geniales Modul, danke dafür. Funktioniert super bei mir in der Nextcloud.

Ist vielleicht noch geplant oder währe es möglich, eine Funktion einzubauen, das die Anzahl der Backups begrenzt werden kann.
Ein Beispiel: Ich mache ein wöchentliches Backup und das Script lädt die in die Cloud, sind es 8 Backups, wird das achte Backup automatisch gelöscht.

Gruß ErzGabriel

Hallo,

Es ist in der Tat geplant sowas ein zu bauen. Wird aber wohl noch etwas dauern.
https://git.cooltux.net/FHEM/mod-backupToStorage/issues/2
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

der-Lolo

Ich habe mich heute morgeen auch versucht die FHEM Backups auf dem Sysnology abzulegen - so ganz rund läuft das noch nicht...
Bleibst Du was die Integration von DS_Starters SSFile angeht auch am Ball..?

CoolTux

Zitat von: der-Lolo am 14 März 2021, 11:13:16
Ich habe mich heute morgeen auch versucht die FHEM Backups auf dem Sysnology abzulegen - so ganz rund läuft das noch nicht...
Bleibst Du was die Integration von DS_Starters SSFile angeht auch am Ball..?

Ja natürlich. Soweit es meine Zeit zu lässt. Aktuell habe ich null Zeit dafür. Ich habe mit Heiko schon vor Monaten über die Integration gesprochen und mir die Schnittstelle zu seinem Modul beschreiben lassen. Einzig die Integration selbst fehlt leider noch. Sorry.
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

my-engel

Hallo Marko,

ich wollte Dein Modul testen, komme aber nicht weiter.
Seit längerer Zeit benutze ich ein Notify mit einem eingebetteten at  um den aktuellen Gasverbrauch meiner Heizung
mittels eines GPIOGaszaehler in m3/Std in einen Dummy schreiben zu lassen.
Dies funktioniert tadellos, jedoch scheint dein Modul jetzt auch darauf aufzusetzen.
Wenn ich backupToStorage mit verbose 5 laufen lasse erscheint im log:
2021.03.19 17:55:38.722 4: backupToStorage (myNextcloudUpload) -
          Devname: global
          Name: myNextcloudUpload
          Notify: $VAR1 = [
  'MODIFIED tmp_time_gas'
];

Es funktioniert natürlich nicht und normal sollte doch sein?:
2021.03.20 14:24:01 4: backupToStorage (myNextcloudUpload) -
          Devname: global
          Name: myNextcloudUpload
          Notify: $VAR1 = [
          'backup done'
        ];

Hast du eine Idee??

MfG Uwe

CoolTux

Hallo Uwe,

Die Ausgabe für verbose 5 ist korrekt. Das Modul selbst triggert auch bei globalen Events, was bei Deinem Log der Fall ist. Es verarbeitet aber diesen Event dann nicht weiter da der globale Event für das Modul unwichtig ist.

Die Frage die ich mir jetzt stelle, wo genau kommst Du nicht weiter? Funktioniert der Upload nicht? Hast Du mal manuell backup ausgeführt?
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

my-engel

Hallo Marko,

ok Danke. Habe jetzt auf einem anderen RPI zum Test auch eingerichtet und das gleiche Problem.
Backup wird erstellt -> backupToStorage triggert aber lädt nichts hoch, kommt aber auch keine Fehlermeldung.
2021.03.20 14:18:43 4: backupToStorage (myNextcloudUpload) -
          Devname: global
          Name: myNextcloudUpload
          Notify: $VAR1 = [
          'ATTR myNextcloudUpload verbose 5'
        ];

2021.03.20 14:18:43 4: backupToStorage (myNextcloudUpload) - Read password from file
2021.03.20 14:18:51 4: backupToStorage (myNextcloudUpload) -
          Devname: global
          Name: myNextcloudUpload
          Notify: $VAR1 = [
          'SAVE'
        ];

2021.03.20 14:18:59 2: Backup with command: tar czf ./backup/FHEM-20210320_141859.tar.gz "./ferien.ics" "./docs" "./feiertage.ics" "./lib" "./log" "./AlarmFILE" "./certs" "./fhem.cfg-org" "./YAAHMFILE" "./fhem.pl" "./www" "./unused" "./HM-Firmware" "./restoreDir" "./fhem.cfg" "./FHEM" "./demolog" "./muell.ics" "./README_DEMO.txt" "./contrib" "./fhem.cfg.demo" "./GPL_V2.txt" "./configDB.pm" "./CHANGED" "./MAINTAINER.txt"
2021.03.20 14:18:59 3: telnetForBlockingFn_1616246339: port 43119 opened
2021.03.20 14:18:59 3: backup : Started the backup in the background, watch the log for details
Backup done
2021.03.20 14:24:01 4: backupToStorage (myNextcloudUpload) -
          Devname: global
          Name: myNextcloudUpload
          Notify: $VAR1 = [
          'backup done'
        ];

2021.03.20 14:24:01 4: backupToStorage (myNextcloudUpload) - push to storage function
2021.03.20 14:34:59 4: backupToStorage (myNextcloudUpload) - Read password from file
2021.03.20 14:35:09 4: backupToStorage (myNextcloudUpload) - Read password from file
2021.03.20 14:35:09 4: backupToStorage (myNextcloudUpload) - Read password from file
2021.03.20 14:43:41 4: backupToStorage (myNextcloudUpload) - Read password from file
2021.03.20 14:43:56 4: backupToStorage (myNextcloudUpload) - Read password from file
2021.03.20 14:43:56 4: backupToStorage (myNextcloudUpload) - Read password from file
2021.03.20 16:41:24 4: backupToStorage (myNextcloudUpload) - Read password from file
2021.03.20 16:41:30 4: backupToStorage (myNextcloudUpload) - Read password from file
2021.03.20 16:41:45 4: backupToStorage (myNextcloudUpload) - Read password from file
2021.03.20 16:41:54 4: backupToStorage (myNextcloudUpload) - Read password from file
2021.03.20 16:41:54 4: backupToStorage (myNextcloudUpload) - Read password from file

jump to the top

und in den Readings ist nichts zun sehen.
Nextcloud läuft allerdings im gleichen Netzwerk aber die DNS Auflösung funktioniert und
von anderen Rechnern im gleichen Netz komme ich auch auf den Nextcloud...
und das Passwort habe ich auch geprüft.
Hier noch das list:
Internals:
   CFGFN     
   FUUID      6055f4d2-f33f-0309-9923-061e958a4899c725
   NAME       myNextcloudUpload
   NOTIFYDEV  global,myNextcloudUpload
   NR         155
   NTFY_ORDER 51-myNextcloudUpload
   STATE      ready
   STORAGETYPE Nextcloud
   TYPE       backupToStorage
   VERSION    v1.2.3
   READINGS:
     2021-03-20 14:18:59   fhemBackupFile  ./backup/FHEM-20210320_141859.tar.gz
     2021-03-20 14:18:05   state           ready
Attributes:
   bTS_Host   next.xxxx.de
   bTS_Path   /fhem_Backup_RPI3
   bTS_User   FHEM
   group      Backup
   room       System
   verbose    5


Hast du noch eine Idee??

MfG Uwe


CoolTux

Hallo Uwe,

Sieht so aus als wenn Dein Backup relativ lange laufen würde. Kannst Du mir sagen ob es länger wie 3 Minuten läuft?


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

my-engel

Hallo Marko,

ich denke ja...
2021.03.20 17:41:58 3: backup : Started the backup in the background, watch the log for details
Backup done
2021.03.20 17:46:42 4: backupToStorage (myNextcloudUpload) -
          Devname: global
          Name: myNextcloudUpload
          Notify: $VAR1 = [
          'backup done'
        ];

2021.03.20 17:46:42 4: backupToStorage (myNextcloudUpload) - push to storage function

scheinen auf dem Testsystem knapp 5 Min. zu sein...

MfG Uwe

CoolTux

Traust Du Dir zu Zeile 403
if ( ReadingsAge($name,'fhemBackupFile',1) > 180 );
zu ändern in
if ( ReadingsAge($name,'fhemBackupFile',1) > 600 );

Das sind dann 10min das sollte locker reichen.

Und dann neustart machen.
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

my-engel

Hallo Marko,

Danke es funktioniert jetzt :

90  116M    0     0   90  105M      0  1404k  0:01:24  0:01:17  0:00:07 1456k
93  116M    0     0   93  108M      0  1427k  0:01:23  0:01:18  0:00:05 1818k
96  116M    0     0   96  112M      0  1453k  0:01:21  0:01:19  0:00:02 2236k
99  116M    0     0   99  115M      0  1474k  0:01:20  0:01:20 --:--:-- 2601k
100  116M    0   321  100  116M      3  1480k  0:01:20  0:01:20 --:--:-- 2931k
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>OCA\DAV\Connector\Sabre\Exception\FileLocked</s:exception>
  <s:message>"FHEM/files/fhem_Backup_RPI3/FHEM-20210320_193246.tar.gz.upload.part" is locked, existing lock on file: exclusive</s:message>
</d:error>

2021.03.20 19:40:03 4: backupToStorage (myNextcloudUpload) - got result from asynchronous parsing: {"ncUpload":"upload successfully"}
2021.03.20 19:40:03 4: backupToStorage (myNextcloudUpload) - asynchronous finished.
2021.03.20 19:40:03 4: backupToStorage (myNextcloudUpload) - clean Subprocess
2021.03.20 19:40:03 3: backupToStorage (myNextcloudUpload) - _CheckIsDisabledAfterSetAttr
2021.03.20 19:40:03 4: backupToStorage (myNextcloudUpload) -
          Devname: myNextcloudUpload
          Name: myNextcloudUpload
          Notify: $VAR1 = [
          'state: ready',
          'uploadState: upload successfully'
        ];


jump to the top


es funktioniert auf dem Testsystem mit RPI3 und auch Fhem auf einem RPI4 in Docker ...
habe noch auf 900 sec angepasst, da der Test-PI 5Min. und der in Docker fast 10 Min. benötigte.
vielleicht kannst Du das noch anpassen? oder evtl. auch als Attribut?

auf einer FritzBox funktioniert es nicht, hier scheint es aber an der Version von curl zu liegen.
Ist aber nicht so wichtig, habe hier nur Interesse halber getestet.
Nutze da die Funktion in TBflex-3.1 und das reicht mir....
2021.03.20 19:42:27 4: backupToStorage (myNextcloudUpload) -
          Devname: global
          Name: myNextcloudUpload
          Notify: $VAR1 = [
          'backup done'
        ];

2021.03.20 19:42:27 4: backupToStorage (myNextcloudUpload) - push to storage function
2021.03.20 19:42:27 4: backupToStorage (myNextcloudUpload) - after readings age return
2021.03.20 19:42:27 4: backupToStorage (myNextcloudUpload) - Read password from file
sh: illegal option -k
backupToStorage File Upload - FileUpload Nextcloud, returnCode: 16777215 , returnString:
2021.03.20 19:42:27 3: backupToStorage (myNextcloudUpload) - _CheckIsDisabledAfterSetAttr
2021.03.20 19:42:27 4: backupToStorage (myNextcloudUpload) -
          Devname: myNextcloudUpload
          Name: myNextcloudUpload
          Notify: $VAR1 = [
          'state:  file upload in progress'
        ];

2021.03.20 19:42:27 4: backupToStorage (myNextcloudUpload) - execute command asynchronously (PID="5460")
2021.03.20 19:42:27 4: backupToStorage (myNextcloudUpload) - control passed back to main loop.
2021.03.20 19:42:28 4: backupToStorage (myNextcloudUpload) - got result from asynchronous parsing: {"ncUpload":"unknown error"}
2021.03.20 19:42:28 4: backupToStorage (myNextcloudUpload) - asynchronous finished.
2021.03.20 19:42:28 4: backupToStorage (myNextcloudUpload) - clean Subprocess
2021.03.20 19:42:28 3: backupToStorage (myNextcloudUpload) - _CheckIsDisabledAfterSetAttr
2021.03.20 19:42:28 4: backupToStorage (myNextcloudUpload) -
          Devname: myNextcloudUpload
          Name: myNextcloudUpload
          Notify: $VAR1 = [
          'state: ready',
          'uploadState: unknown error'
        ];


Danke noch mal und schönen Abend noch
VG Uwe

kabanett

Hallo zusammen,
ich habe hier zufällig diesen Beitrag gefunden und die Idee ein BackUp auf dem NAS zu sichern ist super!
Leider habe ich ein Qnap und die Einstellungen, wie im ersten Beitrag funktionieren bei mir nicht.
Ein User Fhem mit Passwort ist auf dem Qnap angelegt. Ebenso ein eigener Ordner mit entsprechenden Rechten.
Nach einem Test- BackUp wurde nichts geschrieben. Was mache ich falsch? Kann man das Modul nicht für Qnap nutzen?

Hier ein List
Internals:
   .FhemMetaInternals 1
   CFGFN     
   FUUID      605684ed-f33f-0fc8-85c1-2007203c683c8ad2
   NAME       NAS_BackUp
   NOTIFYDEV  global,NAS_BackUp
   NR         3635
   NTFY_ORDER 51-NAS_BackUp
   STATE      ready
   STORAGETYPE SynologyFileStation
   TYPE       backupToStorage
   VERSION    v1.2.3
   .attraggr:
   .attrminint:
   READINGS:
     2021-03-21 15:18:30   fhemBackupFile  ./backup/FHEM-20210321_151830.tar.gz
     2021-03-21 00:34:36   state           ready
Attributes:
   bTS_Host   192.168.xxx.xxx
   bTS_Path   /Fhem/FhemBackUp
   bTS_Type   SynologyFileStation
   bTS_User   Fhem


Gruß

Hardware: Fhem auf Raspi3 / selbtsbau CUL 433 und 868 MHz / MAX Thermostate / IT-Dosen nur noch Weihnachten / diverse ESP Aktoren/Sensoren / X10 Fernbedienung / Shelly 1, 1L, 2, 2.5, Dimmer, RGB2 / LaCrosseGateway / Zigbee2531 / diverse Zigbee Aktoren/Sensoren

CoolTux

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

kabanett

Achso, schade!
Ausschließlich sollte bTS_Type   SynologyFileStation auschließen ;D
Dann viel Spaß damit! (Bevor das falsch ankommt... nicht Ironisch gemeint)

Gruß
Hardware: Fhem auf Raspi3 / selbtsbau CUL 433 und 868 MHz / MAX Thermostate / IT-Dosen nur noch Weihnachten / diverse ESP Aktoren/Sensoren / X10 Fernbedienung / Shelly 1, 1L, 2, 2.5, Dimmer, RGB2 / LaCrosseGateway / Zigbee2531 / diverse Zigbee Aktoren/Sensoren

CoolTux

Für Synology ist bereits Unterstützung in Arbeit. Für andere Systeme habe ich aktuell leider keine Zeit.
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

det.

Zitat von: CoolTux am 21 März 2021, 17:56:21
Für Synology ist bereits Unterstützung in Arbeit. Für andere Systeme habe ich aktuell leider keine Zeit.


Hallo CoolTux,
Bin aktuell wegen Deinem Modul und natürlich denen von DS_Starter von Qnap zu einer Synology gewechselt. Alles sehr schön, nur die Datensicherung kommt nicht auf der Synology an.  - gibt es dazu einen neuen aktuellen Stand?
LG
det.