snaptec / openWB

openWB - die modulare Wallbox
https://openwb.de
GNU General Public License v3.0
341 stars 205 forks source link

Add FTP as a backup target and schedule nightly backup job #2806

Open Fluxxo opened 7 months ago

Fluxxo commented 7 months ago

I made some changes to the way backups work in openwb1.9:

1) The "Backup erstellen" menu is gone, instead leading to a configuration page 2) Users can now decide where they want the backup to be stored: (a) Locally under /var/www/html/openWB/backup or remotely on an FTP server. The page performs a check whether the FTP credentials are correct and the remote folder is accessible. 3) Added fields to configure FTP connection 4) Added flag whether a nightly backup should be performed 5) Added a flag whether to apply filename backup.tar.gz or openWBbackup$jahr-$monat-$tag-$hourofday-$minute.tar.gz. 6) Added a button to manually perform a backup into the desired destination. 7) Adjusted the nightly cronjob to perform the backup if configured. 8) Backup can still be triggered manually via HTTP, but the URL changed from backup.php to savebackup.php 9) savebackup.php will spit out curl error codes in case it cannot store the backup.

benderl commented 6 months ago

This will make existing external solutions for scheduled backups useless. These scripts rely on the behaviour of the current backup.php.

Fluxxo commented 6 months ago

Would it change it I renamed the savebackup.php back to backup.php and ported the backup.php feature into a renamed settings page? URL calls would remain the same and the default behaviour as well, while still extending current functionality.