I have created a solution to backup files and folders to a remote CIFS file share (in my case Synology). It does not require FTP and is very easy to use. I could not find an easy manual to do this, so here you go. Basic Linux knowledge is required.
Step 1: create a file share on your target device (e.g. Synology, QNAP or Windows) and create a user with write permissions. There are plenty of manuals how to do this. My remote folder is called \\diskstation\User\domoticz
Step 2: create a folder on your Domoticz server to mount the share (I use /diskstation):
Code: Select all
sudo mkdir /diskstation
Code: Select all
sudo vi /etc/fstab
Code: Select all
//192.168.1.100/User/domoticz /diskstation cifs _netdev,username=<yourusername>,password=<yourpassword>,dir_mode=0755,file_mode=0755,uid=1000,gid=1000 0 0
Code: Select all
sudo mount /diskstation
Code: Select all
mount /diskstation
ls -l /diskstation
touch /diskstation/testfile
ls -l /diskstation
rm /diskstation/testfile
mkdir /diskstation/backup
Code: Select all
vi ~/backup_domoticz.sh
Code: Select all
#!/bin/bash
DESTDIR="/diskstation/backup"
DOMO_IP="192.168.1.99" # Domoticz IP
DOMO_PORT="8080" # Domoticz port
/usr/bin/curl -s http://$DOMO_IP:$DOMO_PORT/backupdatabase.php > /$DESTDIR/domoticz_backup.db
cp -r /home/pi/domoticz/scripts/ $DESTDIR
Code: Select all
crontab -e
Code: Select all
50 23 * * * ~/backup_domoticz.sh