Page 1 of 1

backup to synology nas error in script

Posted: Saturday 09 April 2016 15:48
by curious
I want to backup to my synology nas and used the scripts mentioned in the wiki.

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!

Re: backup to synology nas error in script

Posted: Saturday 09 April 2016 15:53
by jvdz
could it be the file format?
how are you editing this file?

Jos

Re: backup to synology nas error in script

Posted: Saturday 09 April 2016 16:37
by curious
at first a copied te script from wiki to notepad. Later on I modified the file with notepad++
I copy the file with filezilla

Re: backup to synology nas error in script

Posted: Saturday 09 April 2016 16:44
by jvdz
Check whether you have the newline set to LF in stead of CRLF as that is a common issue for files coming from Windows.

Jos

Re: backup to synology nas error in script

Posted: Saturday 09 April 2016 17:35
by curious
Thanks jvdz ...solved