However I get a strange error message and don't know why (I am a noob)
I get several lines like this :
not foundmoticz/scripts/domoticz_backup.sh 17 :/home/pi/domoticz/scripts.domoticz_backup.sh:
yes indeed it says foundmoticz
Every time the error appears but with different line numbers 2,11,14,17 and later on 20, and 23
Besides that I get the message URL useing bad/illegal format or missing url
and /bin/rm: cannot remove '/tmp/domoticz_backup20160409151489\r.tar.gz\r':No such file or directory
I think i some files and directories are missing or at the wrong place
Anyone knows what is wrong.
This is my code
Code: Select all
#!/bin/bash
## LOCAL/FTP/SCP/MAIL PARAMETERS
SERVER="xx.xx.xx.xxx" # IP of Network disk, used for: ftp mail scp
USERNAME="xxxxxxx" # FTP username of Network disk used for: ftp mail scp
PASSWORD="xxxxxxxxxx" # FTP password of Network disk used for: ftp mail scp
DESTDIR="/pi/backup" # used for: local
DOMO_IP="10.0.0.12" # Domoticz IP used for all
DOMO_PORT="8080" # Domoticz port used for all
## END OF USER CONFIGURABLE PARAMETERS
TIMESTAMP=`/bin/date +%Y%m%d%H%M%S`
BACKUPFILEDIR="domoticz_backup_$TIMESTAMP.tar.gz" # Change the xxx to yours
### Create backup and ZIP it
tar -zcvf /tmp/$BACKUPFILEDIR /home/pi/domoticz/temp/ # Change the xxx to yours # Or try /home/pi/domoticz/
### Send to Network disk through FTP
curl -s --disable-epsv -v -T"/tmp/$BACKUPFILEDIR" -u"$USERNAME:$PASSWORD" "ftp://$SERVER/usbshare1/raspberybackup/" # Change the ftp to yours !!!
### Remove temp backup file
/bin/rm /tmp/$BACKUPFILEDIR
### Done!