Though you might use industrial storage solutions for the WebHMI, still there is always a risk of loosing your data in some cases:
There is only one example how to avoid the consequences of data loss.
Here is an example of how to setup your Linux machine to automatically save files from the
/log folder on the WebHMI's storage:
#!/bin/bash # Create a folder ~/WEBHMI/log_backup, with the /tmp sub-folder. LOG_DIR="$HOME/WEBHMI/log_backup" # download the yesterday's log file to backup storage yesterday=$(date +"%Y-%m-%d" -d yesterday) cd $LOG_DIR # because login and pass for the ftp connection are unencrypted you can # restrict read/write access mode to the file with chmod command) wget --user=admin --password='webhmi' ftp://192.168.1.1/log/log-$yesterday.sqlite3 #archive to save storage space gzip -v log-$yesterday.sqlite3
Add the script to the crontab with the parameters:
10 0 * * * /path_to_run/backup.sh
to run it every day at 00:10
Do not forget grant additional run permissions
chmod a+x /path_to_run/backup.sh
New files will only be added to ~/WEBHMI/log_backup, nothing will be deleted from this folder.