backup to synology nas error in script

Moderator: leecollings

Post Reply
curious
Posts: 132
Joined: Saturday 02 April 2016 19:38
Target OS: -
Domoticz version:
Contact:

backup to synology nas error in script

Post 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!
User avatar
jvdz
Posts: 2445
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: backup to synology nas error in script

Post by jvdz »

could it be the file format?
how are you editing this file?

Jos
curious
Posts: 132
Joined: Saturday 02 April 2016 19:38
Target OS: -
Domoticz version:
Contact:

Re: backup to synology nas error in script

Post 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
User avatar
jvdz
Posts: 2445
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: backup to synology nas error in script

Post 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
curious
Posts: 132
Joined: Saturday 02 April 2016 19:38
Target OS: -
Domoticz version:
Contact:

Re: backup to synology nas error in script

Post by curious »

Thanks jvdz ...solved
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest