Tar -zcvf /volume1/dataschijf/Domoticz_backup/scripts/domoticz_scripts_ $ -zcvf /volume1/dataschijf/Domoticz_backup/ backups older than 31 days usr/bin/curl -s $DOMO_IP: $DOMO_PORT/backupdatabase.php > /volume1/dataschijf/Domoticz_backup/database/ $BACKUPFILE db" # backups will be named "domoticz_YYYYMMDDHHMMSS.db.gz" BACKUPFILEGZ = " $BACKUPFILE ".gz #!/bin/bash DOMO_IP = "192.168.4.4" # Domoticz IP DOMO_PORT = "8084" # Domoticz port # END OF USER CONFIGURABLE PARAMETERS TIMESTAMP = `/bin/date +%Y%m%d%H%M%S ` BACKUPFILE = "domoticzbackup_ $TIMESTAMP. Storing backups on the same device is not recommended, but i have placed them in a folder that gets copied every night to an off-site NAS. The script below can be used to create backups and store them on the same device. bin/rm /tmp/ $BACKUPFILEDIR # Done! Script to backup to local folders (database + multiple folders) Tar -zcvf /tmp/ $BACKUPFILEDIR /home/pi/domoticz/aaax/ # Change the aaa to yours # Or try /home/pi/domoticz/ # Send to Network disk through FTPĬurl -s -disable-epsv -v -T "/tmp/ $BACKUPFILEDIR " -u " $USERNAME : $PASSWORD " "ftp:// $SERVER /media/hdd/Domoticz_backup/" # Change the ftp to yours !!! # Remove temp backup file tar.gz" # Change the aaa to yours # Create backup and ZIP it #!/bin/bash # LOCAL/FTP/SCP/MAIL PARAMETERS SERVER = "192.168.5.10" # IP of Network disk, used for: ftp mail scp USERNAME = "root" # FTP username of Network disk used for: ftp mail scp PASSWORD = "root" # FTP password of Network disk used for: ftp mail scp DESTDIR = "/opt/backup" # used for: local DOMO_IP = "192.168.5.75" # Domoticz IP used for all DOMO_PORT = "8081" # Domoticz port used for all # END OF USER CONFIGURABLE PARAMETERS TIMESTAMP = `/bin/date +%Y%m%d%H%M%S ` BACKUPFILEDIR = "domoticz_x_aaa_ $TIMESTAMP. This script doesn't backup the domoticz.db database, see the script above. The script below will backup the folder specified ( /home/pi/domoticz/aaax/, change aaax to the folder you want to have backupped) to the FTP-location specified. Script to backup to FTP-server (multiple folders) Gzip -9 /tmp/ $BACKUPFILE # Send to Network disk through FTPĬurl -s -disable-epsv -v -T "/tmp/ $BACKUPFILEGZ " -u " $USERNAME : $PASSWORD " "ftp:// $SERVER /media/hdd/Domoticz_backup/" # Remove temp backup file usr/bin/curl -s $DOMO_IP: $DOMO_PORT/backupdatabase.php > /tmp/ $BACKUPFILE # create backup, ZIP it and start Domoticz again #!/bin/bash # LOCAL/FTP/SCP/MAIL PARAMETERS SERVER = "192.168.0.10" # IP of Network disk, used for ftp USERNAME = "root" # FTP username of Network disk used for ftp PASSWORD = "root" # FTP password of Network disk used for ftp DESTDIR = "/opt/backup" # used for temorarily storage DOMO_IP = "192.168.0.90" # Domoticz IP DOMO_PORT = "8080" # Domoticz port # END OF USER CONFIGURABLE PARAMETERS TIMESTAMP = `/bin/date +%Y%m%d%H%M%S ` BACKUPFILE = "domoticz_ $TIMESTAMP. However, you probably also use some scripts that you want to backup too, so you probably want the script further down this page. The script below will save a copy of your 'domoticz.db' (database) to the folder specified. Place the script below in: /home/pi/domoticz/scripts and change the parameters to reflect to your settings.ĭifferent scripts Script to backup to FTP-server (only Domoticz database) Fill in your local network IP-address ( 192.168.1.* for example), otherwise the backup will fail. if your Domoticz webpage is password protected, that you enable Local Networks (no username/password)in your settings. Make sure that if you have enabled website protection, e.g. Check that FTP is enabled and have login credentials available. Search the folder on your Network Attached Storage (NAS) where you want the backups to be stored. This page will provide you several backupscripts, each with other functions. However in the case the SD-card crashes and is no longer accessible, a lot of work still could be lost. You just need to tick the Enable Automatic Backup option in System setup. 5 Schedule daily execution of the scriptĭomoticz has a built in feature to automatically create hourly, daily and monthly database backups in the /home/pi/domoticz/backups/ directory.3.3 Script to backup to local folders (database + multiple folders).3.2 Script to backup to FTP-server (multiple folders).3.1 Script to backup to FTP-server (only Domoticz database).
0 Comments
Leave a Reply. |