diff --git a/openwb.conf b/openwb.conf index c5600b81c..2ea243ca8 100755 --- a/openwb.conf +++ b/openwb.conf @@ -270,3 +270,10 @@ soc_aiwayslp2_user='' soc_aiwayslp2_pass='' soc_aiwayslp2_vin='' soc_aiwayslp2_intervall='' +backuptarget=ftp +ftphost=192.168.170.1 +ftppath=/UBUNTU_20_0 +ftpuser=ftp +ftppass=bh220540 +nightlybackup=1 +shortbackupfilename=1 diff --git a/runs/cronnightly.sh b/runs/cronnightly.sh index d5779914b..8716e66fc 100755 --- a/runs/cronnightly.sh +++ b/runs/cronnightly.sh @@ -148,3 +148,24 @@ done # monthly . csv updaten echo "Trigger update of logfiles..." python3 /var/www/html/openWB/runs/csvcalc.py --input /var/www/html/openWB/web/logging/data/daily/ --output /var/www/html/openWB/web/logging/data/v001/ --partial /var/www/html/openWB/ramdisk/ --mode A >> /var/www/html/openWB/ramdisk/csvcalc.log 2>&1 & + +#check if backup is configured - if yes, let's go +if [[ $nightlybackup == 1 ]]; then + echo "Nightly backup turned on. Performing backup." + port=$WEB_PORT + if [[ -z "$port" ]]; then + port=80 + fi + + if (( $shortbackupfilename == 0)); then + shortbackupfilename=1 + else + shortbackupfilename=0 + fi + + url="http://127.0.0.1:$port/openWB/web/settings/savebackup.php?extendedFilename=$shortbackupfilename" + echo "Using url $url" + curl -s -o /dev/null $url +else + echo "Nightly backup turned off. Doing nothing." +fi \ No newline at end of file diff --git a/web/settings/backup.php b/web/settings/backup.php index 5d7e1699e..f4f382a60 100644 --- a/web/settings/backup.php +++ b/web/settings/backup.php @@ -1,23 +1,3 @@ - @@ -26,9 +6,8 @@ - - Backup erstellen - + + openWB Einstellungen @@ -45,7 +24,6 @@ - @@ -53,44 +31,162 @@ - + +
- -

Backup erstellen

-
- Backup-Datei erfolgreich erstellt. +

OpenWB Backup

+
+
+
+ Backup-Ziel + +
+
+
+
+ +
+ +
+
+
+ +
+ + /> +
+
+
+ +
+ + /> + Wenn aktiviert, wird die Datei unter den Namen backup.tar.gz am Zielort abgelegt. Wenn nicht aktiviert, wird die Datei unter dem Muster "openWB_backup_$jahr-$monat-$tag-$hourofday-$minute.tar.gz" abgelegt (Beispiel: openWB_backup_2023-11-30_17-19-11.tar.gz) +
+
+
+
+
+
+
+ +
+ + Der FTP-Host als voller DNS-Name oder IP-Adresse +
+
+
+ +
+ + + Der Pfad auf dem Zielsystem, zB /Backups/openwb +
+
+
+
+
+ +
+ + Der Nutzername für das FTP-System +
+
+
+ +
+ + Das FTP-Passwort, gespeichert in der openwb.conf +
+
+ +
+
+ +
-
diff --git a/web/settings/navbar.html b/web/settings/navbar.html index e9c6b4279..d47da29a2 100644 --- a/web/settings/navbar.html +++ b/web/settings/navbar.html @@ -64,7 +64,7 @@ System