Different Backups from Crontab to network

All kinds of 'OS' scripts
sschouten
Posts: 6
Joined: Thursday 23 April 2015 13:54
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Different Backups from Crontab to network

Post by sschouten » Monday 19 June 2017 23:51

i found my problem,
i was edtitng the script whit notepad++ but did not chnage to LF now the script is working fine :)

renerene
Posts: 116
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: Different Backups from Crontab to network

Post by renerene » Sunday 25 June 2017 20:55

sebitop wrote:2 MB this is the point !

if I directly ave the db from the browser, the file is 2 MB and I can restore it.

if I simply use : /usr/bin/curl http://192.168.0.30:8080/backupdatabase.php > /tmp/test.db

test.db is 91kb .... and impossible to restore it
same here. Any solutions yet?

User avatar
Derik
Posts: 2097
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Different Backups from Crontab to network

Post by Derik » Sunday 25 June 2017 23:24

Code: Select all

#!/bin/bash
    # LOCAL/FTP/SCP/MAIL PARAMETERS
    SERVER="192.168.6.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.6.70"      # 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`
    BACKUPFILE="Xu4_Domoticz_DB_$TIMESTAMP.db" # verander  domoticz_xx_  en je backup krijgt deze naam.
    BACKUPFILEGZ="$BACKUPFILE".gz
#
    ### Create backup and ZIP it
    /usr/bin/curl -s http://$DOMO_IP:$DOMO_PORT/backupdatabase.php > /tmp/$BACKUPFILE
    gzip -9 /tmp/$BACKUPFILE
#
    ### Send to Network disk through FTP
    curl -s --disable-epsv -v -T"/tmp/$BACKUPFILEGZ" -u"$USERNAME:$PASSWORD" "ftp://$SERVER/media/hdd/Domoticz_backup/"
#													
    ### Remove temp backup file
    /bin/rm /tmp/$BACKUPFILEGZ
#
    ### Done!
    # noot gebruik zo min mogelijk spaties En zorg dat het adres via filezilla gezien is

try this..
Activate with a crontab
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups

renerene
Posts: 116
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: Different Backups from Crontab to network

Post by renerene » Tuesday 04 July 2017 23:14

Derik wrote: try this..
I've compared the code with my own that does not work, looks the same:
(variable DESTDIR is old?)

Code: Select all

#!/bin/bash
    # LOCAL/FTP/SCP/MAIL PARAMETERS
    SERVER="192.168.0.20"  # IP of Synology NAS, used for ftp
    USERNAME="xxxx"         # FTP username of Network disk used for ftp
    PASSWORD="xxxx"         # FTP password of Network disk used for ftp
    DESTDIR="/opt/backup"   # used for temorarily storage <-- wordt verderop niet gebruikt??
    #DESTDIRNAS="/homes/domoticz/backup/" # Path to your Synology NAS backup folder
    DESTDIRNAS="/domoticz/" # Path to your Synology NAS backup folder
    DOMO_IP="192.168.0.xxx"   # Domoticz IP 
    DOMO_PORT="8080"        # Domoticz port 
    ### END OF USER CONFIGURABLE PARAMETERS

    TIMESTAMP=`/bin/date +%Y%m%d%H%M%S`
    BACKUPFILE="domoticz_$TIMESTAMP.db" # backups will be named "domoticz_YYYYMMDDHHMMSS.db.gz"
    BACKUPFILEGZ="$BACKUPFILE".gz
    ### Create backup and ZIP it
    /usr/bin/curl -s http://$DOMO_IP:$DOMO_PORT/backupdatabase.php > /tmp/$BACKUPFILE
    gzip -9 /tmp/$BACKUPFILE
    tar -zcvf /tmp/domoticz_scripts_$TIMESTAMP.tar.gz /home/pi/domoticz/scripts/
    #tar -zcvf /tmp/telegram_scripts_$TIMESTAMP.tar.gz /home/pi/tg/scripts/
    ### Send to Network disk through FTP
    curl -s --disable-epsv -v -T"/tmp/$BACKUPFILEGZ" -u"$USERNAME:$PASSWORD" "ftp://$SERVER/$DESTDIRNAS"
    curl -s --disable-epsv -v -T"/tmp/domoticz_scripts_$TIMESTAMP.tar.gz" -u"$USERNAME:$PASSWORD" "ftp://$SERVER/$DESTDIRNAS"
    #curl -s --disable-epsv -v -T"/tmp/telegram_scripts_$TIMESTAMP.tar.gz" -u"$USERNAME:$PASSWORD" "ftp://$SERVER/$DESTDIRNAS"
    ### Remove temp backup file
    /bin/rm /tmp/$BACKUPFILEGZ
    /bin/rm /tmp/domoticz_scripts_$TIMESTAMP.tar.gz
    #/bin/rm /tmp/telegram_scripts_$TIMESTAMP.tar.gz
    ### Done!

User avatar
Derik
Posts: 2097
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Different Backups from Crontab to network

Post by Derik » Sunday 27 August 2017 14:43

Dear all...

i have a minecraft server for my kids on a BP1 M2
Running great...
Only they build and build like real miners..

I wil try to make a backup with a loop from a week.
Backup everyday monday / sunday, en then again... [ overwrite teh backups ]

The problem i am a noob...

I still have a script only do not get this working.

setup BPi runs on latest armbian.

i do have a hdd in my network i can reach with ftp etc. [ it is a HDD in satellite receiver, from lan with direct acces, with ftp i need root root to login ]
ScreenShot131.png
ScreenShot131.png (22.46 KiB) Viewed 1833 times
And the route to it:
\\ET9X00\Harddisk\minecraft
I created on that hdd a map minecraft where i try to place the backups.

The script i use:

Code: Select all

#!/bin/sh
####################################
#
# Backup minecraft world to a
# specified folder.
#
####################################

# What to backup.  Name of minecraft folder
backup_files="minecraft"

# Where to backup to. I backup to an external hd connected
# to my Pi.  enter the folder name where you want your backups to go.
# Just make sure you have enough space to hold 7 days of backups. This
# can be on the pi itself, to an external hard drive or mounted network share.
dest="/et9x00/media/hdd/minecraft"

# Create backup archive filename.
day=$(date +%A)
archive_file="$day-$backup_files-.tar.gz"

# Backup the files using tar.
cd /root && tar zcvf $dest/$archive_file $backup_files

From a Minecraft site.....
The problem this script is not working :-)

Is there perhaps a option that i can run a script from Domoticz
To make a backup from my Bpi to the hdd in my network..

Hope some one can/will help me this script..
I am a noob, in scripting....


Thanks from my kids..... [ And there friends..:-) ]
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups

User avatar
Derik
Posts: 2097
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Different Backups from Crontab to network

Post by Derik » Friday 08 September 2017 8:11

did install domoticz on the Bpi... En can make a daily backup like i did with the domoticz map.
So works fine....

Only is there perhaps a option to remove automatically a backup from my backup hdd.

Or a overwrite option?
Like i make a weakly backup that is overwrite after 4 weeks
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups

astrapowerrr
Posts: 55
Joined: Tuesday 31 January 2017 21:34
Target OS: -
Domoticz version:
Contact:

Re: Different Backups from Crontab to network

Post by astrapowerrr » Thursday 28 December 2017 23:19

hi

i have trouble with the script can someone help me??

Code: Select all

#!/bin/bash
    # LOCAL/FTP/SCP/MAIL PARAMETERS
    SERVER="192.168.1.100"  # IP of Synology NAS, used for ftp
    USERNAME="Marco"         # FTP username of Network disk used for ftp
    PASSWORD="XXXX"         # FTP password of Network disk used for ftp
    DESTDIR="/opt/backup"   # used for temorarily storage
    DESTDIRNAS="ftp://openmediavault.local/cfs_share02/domoticz_backup" # Path to your Synology NAS backup folder
    DOMO_IP="192.168.1.101"   # Domoticz IP 
    DOMO_PORT="8080"        # Domoticz port 
    ### END OF USER CONFIGURABLE PARAMETERS
    TIMESTAMP=`/bin/date +%Y%m%d%H%M%S`
    BACKUPFILE="domoticz_$TIMESTAMP.db" # backups will be named "domoticz_YYYYMMDDHHMMSS.db.gz"
    BACKUPFILEGZ="$BACKUPFILE".gz
    ### Create backup and ZIP it
    /usr/bin/curl -s http://$DOMO_IP:$DOMO_PORT/backupdatabase.php > /tmp/$BACKUPFILE
    gzip -9 /tmp/$BACKUPFILE
    tar -zcvf /tmp/domoticz_scripts_$TIMESTAMP.tar.gz /home/pi/domoticz/scripts/
    tar -zcvf /tmp/telegram_scripts_$TIMESTAMP.tar.gz /home/pi/tg/scripts/
    ### Send to Network disk through FTP
    curl -s --disable-epsv -v -T"/tmp/$BACKUPFILEGZ" -u"$USERNAME:$PASSWORD" "ftp://$SERVER/$DESTDIRNAS"
    curl -s --disable-epsv -v -T"/tmp/domoticz_scripts_$TIMESTAMP.tar.gz" -u"$USERNAME:$PASSWORD" "ftp://$SERVER/$DESTDIRNAS"
    curl -s --disable-epsv -v -T"/tmp/telegram_scripts_$TIMESTAMP.tar.gz" -u"$USERNAME:$PASSWORD" "ftp://$SERVER/$DESTDIRNAS"
    ### Remove temp backup file
    /bin/rm /tmp/$BACKUPFILEGZ
    /bin/rm /tmp/domoticz_scripts_$TIMESTAMP.tar.gz
    /bin/rm /tmp/telegram_scripts_$TIMESTAMP.tar.gz
    ### Done!
i get this error??

Code: Select all

pi@raspberrypi:~ $ sudo /home/pi/domoticz/scripts/domoticz_backup.sh
tar: Leidende '/' wordt uit lidnamen weggelaten
/home/pi/domoticz/scripts/
/home/pi/domoticz/scripts/python/
/home/pi/domoticz/scripts/python/googlepubsub.py
/home/pi/domoticz/scripts/python/domoticz.py
/home/pi/domoticz/scripts/python/script_device_PIRsmarter.py
/home/pi/domoticz/scripts/python/reloader.py
/home/pi/domoticz/scripts/python/__pycache__/
/home/pi/domoticz/scripts/python/__pycache__/domoticz.cpython-34.pyc
/home/pi/domoticz/scripts/python/__pycache__/reloader.cpython-34.pyc
/home/pi/domoticz/scripts/python/script_time_demo.py
/home/pi/domoticz/scripts/python/script_device_demo.py
/home/pi/domoticz/scripts/lua_parsers/
/home/pi/domoticz/scripts/lua_parsers/example_json.lua
/home/pi/domoticz/scripts/lua_parsers/example_xml.lua
/home/pi/domoticz/scripts/lua_parsers/example_owm.lua
/home/pi/domoticz/scripts/lua_parsers/example.lua
/home/pi/domoticz/scripts/logrotate/
/home/pi/domoticz/scripts/logrotate/domoticz
/home/pi/domoticz/scripts/readme.txt
/home/pi/domoticz/scripts/buienradar_rain_example.pl
/home/pi/domoticz/scripts/templates/
/home/pi/domoticz/scripts/templates/Device.Lua
/home/pi/domoticz/scripts/templates/All.Lua
/home/pi/domoticz/scripts/templates/global_data.dzVents
/home/pi/domoticz/scripts/templates/Time.Lua
/home/pi/domoticz/scripts/templates/Seurity.dzVents
/home/pi/domoticz/scripts/templates/All.dzVents
/home/pi/domoticz/scripts/templates/UserVariable.dzVents
/home/pi/domoticz/scripts/templates/Device.dzVents
/home/pi/domoticz/scripts/templates/Security.Lua
/home/pi/domoticz/scripts/templates/Bare.dzVents
/home/pi/domoticz/scripts/templates/Timer.dzvents
/home/pi/domoticz/scripts/templates/All.Python
/home/pi/domoticz/scripts/templates/UserVariable.Lua
/home/pi/domoticz/scripts/lua/
/home/pi/domoticz/scripts/lua/JSON.lua
/home/pi/domoticz/scripts/lua/script_device_sensorWU.lua
/home/pi/domoticz/scripts/lua/script_time_demo.lua
/home/pi/domoticz/scripts/lua/script_device_demo.lua
/home/pi/domoticz/scripts/lua/script_time_toonselector.lua
/home/pi/domoticz/scripts/dzVents/
/home/pi/domoticz/scripts/dzVents/data/
/home/pi/domoticz/scripts/dzVents/data/README.md
/home/pi/domoticz/scripts/dzVents/.gitignore
/home/pi/domoticz/scripts/dzVents/documentation/
/home/pi/domoticz/scripts/dzVents/documentation/dzvents-smoothing.png
/home/pi/domoticz/scripts/dzVents/documentation/history.md
/home/pi/domoticz/scripts/dzVents/documentation/README.md
/home/pi/domoticz/scripts/dzVents/documentation/pandoc.md
/home/pi/domoticz/scripts/dzVents/documentation/README.wiki
/home/pi/domoticz/scripts/dzVents/generated_scripts/
/home/pi/domoticz/scripts/dzVents/generated_scripts/README.md
/home/pi/domoticz/scripts/dzVents/runtime/
/home/pi/domoticz/scripts/dzVents/runtime/Device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/temperature_humidity_barometer_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/soilmoisture_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/zone_heating_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/opentherm_gateway_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/scene_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/leafwetness_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/gas_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/p1_smartmeter_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/barometer_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/lux_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/temperature_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/scaleweight_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/group_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/percentage_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/generic_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/ampere_1_phase_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/voltage_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/evohome_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/solar_radiation_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/distance_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/pressure_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/ampere_3_phase_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/security_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/wind_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/zwave_thermostat_mode_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/kodi_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/thermostat_setpoint_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/airquality_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/Adapters.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/custom_sensor_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/alert_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/rain_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/uv_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/temperature_humidity_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/electric_usage_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/waterflow_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/text_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/switch_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/soundlevel_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/kwh_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/visibility_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/counter_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/humidity_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/rgbw_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/Time.lua
/home/pi/domoticz/scripts/dzVents/runtime/todo.md
/home/pi/domoticz/scripts/dzVents/runtime/Domoticz.lua
/home/pi/domoticz/scripts/dzVents/runtime/Utils.lua
/home/pi/domoticz/scripts/dzVents/runtime/TimedCommand.lua
/home/pi/domoticz/scripts/dzVents/runtime/persistence.lua
/home/pi/domoticz/scripts/dzVents/runtime/Variable.lua
/home/pi/domoticz/scripts/dzVents/runtime/dzVents.lua
/home/pi/domoticz/scripts/dzVents/runtime/misc/
/home/pi/domoticz/scripts/dzVents/runtime/misc/smoothing.xlsx
/home/pi/domoticz/scripts/dzVents/runtime/HistoricalStorage.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/testIntegration.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/varString.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/secArmedAway.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/stage1.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/vdSwitchDimmer.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/README.md
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/File.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/global_data.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/stage2.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/
/home/pi/domoticz/scripts/dzVents/runtime/tests/testUtils.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testTime.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/data/
/home/pi/domoticz/scripts/dzVents/runtime/tests/data/README.md
/home/pi/domoticz/scripts/dzVents/runtime/tests/testDevice.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testVariable.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testScriptdzVentsDispatching.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testTimedCommand.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/.luacov
/home/pi/domoticz/scripts/dzVents/runtime/tests/generated_scripts/
/home/pi/domoticz/scripts/dzVents/runtime/tests/generated_scripts/internal1.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/generated_scripts/internal2.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/.f3.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/f1.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/f1lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/f2.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/.f3.lua.swp
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/lua.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/f3.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testEventHelpers.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/tstData.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/README.md
/home/pi/domoticz/scripts/dzVents/runtime/tests/testEventHelpersStorage.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script1.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_wildcard1.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_with_time-contrained_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_timer_classic.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_inactive.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_variable2.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_incomplete_missing_on.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_notable.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script5.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_timer_table.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_variable1.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script6.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_timer_single.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script7.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script3.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script4.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_incomplete_missing_execute.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script2.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_logging.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/global_data.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_security.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_error.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_data.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_variable3.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_with_active_method.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_security_grouped.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_wildcard2.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_combined.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_timer_function.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testfile
/home/pi/domoticz/scripts/dzVents/runtime/tests/devices.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testDomoticz.lua
/home/pi/domoticz/scripts/dzVents/runtime/EventHelpers.lua
/home/pi/domoticz/scripts/dzVents/examples/
/home/pi/domoticz/scripts/dzVents/examples/notify for dead system-alive check devices.lua
/home/pi/domoticz/scripts/dzVents/examples/intruder alert.lua
/home/pi/domoticz/scripts/dzVents/examples/random night light.lua
/home/pi/domoticz/scripts/dzVents/examples/fake presence.lua
/home/pi/domoticz/scripts/dzVents/examples/garage door.lua
/home/pi/domoticz/scripts/dzVents/examples/check dead devices.lua
/home/pi/domoticz/scripts/dzVents/examples/external_light.lua
/home/pi/domoticz/scripts/dzVents/examples/respond to switch.lua
/home/pi/domoticz/scripts/dzVents/examples/check dead devices by desc.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/
/home/pi/domoticz/scripts/dzVents/examples/templates/bare.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/variable.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/complete.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/timer.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/device.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/global_data.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/security.lua
/home/pi/domoticz/scripts/dzVents/examples/check battery levels.lua
/home/pi/domoticz/scripts/dzVents/examples/schedule fish pond pump.lua
/home/pi/domoticz/scripts/dzVents/examples/leak_detection.lua
/home/pi/domoticz/scripts/dzVents/examples/only run script when button pressed.lua
/home/pi/domoticz/scripts/dzVents/examples/calc temp delta.lua
/home/pi/domoticz/scripts/dzVents/examples/simple room heating with hysteresis control.lua
/home/pi/domoticz/scripts/dzVents/examples/get sensor values.lua
/home/pi/domoticz/scripts/dzVents/scripts/
/home/pi/domoticz/scripts/dzVents/scripts/README.md
/home/pi/domoticz/scripts/_domoticz_main.bat
/home/pi/domoticz/scripts/restart_domoticz
/home/pi/domoticz/scripts/_domoticz_main
/home/pi/domoticz/scripts/update_domoticz
/home/pi/domoticz/scripts/script_time_toonselector.lua
/home/pi/domoticz/scripts/download_update.sh
/home/pi/domoticz/scripts/domoticz_backup.sh
tar: Leidende '/' wordt uit lidnamen weggelaten
tar: /home/pi/tg/scripts: Functie stat() is mislukt: Bestand of map bestaat niet
tar: Gestopt in fouttoestand vanwege eerdere fouten
* Hostname was NOT found in DNS cache
*   Trying 192.168.1.100...
* Connected to 192.168.1.100 (192.168.1.100) port 21 (#0)
< 220 ProFTPD 1.3.5 Server ready.
> USER Marco
< 331 Password required for Marco
> PASS XXXX
< 230-Welcome user Marco@192.168.1.101 to 127.0.1.1 FTP server.
< 230-The local time is: Thu Dec 28 22:15:02 2017
< 230 User Marco logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> CWD ftp:
* ftp_perform ends with SECONDARY: 0
< 550 ftp:: Bestand of map bestaat niet
* Server denied you to change to the given directory
* Uploaded unaligned file size (0 out of 587074 bytes)
* Connection #0 to host 192.168.1.100 left intact
* Hostname was NOT found in DNS cache
*   Trying 192.168.1.100...
* Connected to 192.168.1.100 (192.168.1.100) port 21 (#0)
< 220 ProFTPD 1.3.5 Server ready.
> USER Marco
< 331 Password required for Marco
> PASS XXXX
< 230-Welcome user Marco@192.168.1.101 to 127.0.1.1 FTP server.
< 230-The local time is: Thu Dec 28 22:15:02 2017
< 230 User Marco logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> CWD ftp:
* ftp_perform ends with SECONDARY: 0
< 550 ftp:: Bestand of map bestaat niet
* Server denied you to change to the given directory
* Uploaded unaligned file size (0 out of 226393 bytes)
* Connection #0 to host 192.168.1.100 left intact
* Hostname was NOT found in DNS cache
*   Trying 192.168.1.100...
* Connected to 192.168.1.100 (192.168.1.100) port 21 (#0)
< 220 ProFTPD 1.3.5 Server ready.
> USER Marco
< 331 Password required for Marco
> PASS XXXX
< 230-Welcome user Marco@192.168.1.101 to 127.0.1.1 FTP server.
< 230-The local time is: Thu Dec 28 22:15:02 2017
< 230 User Marco logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> CWD ftp:
* ftp_perform ends with SECONDARY: 0
< 550 ftp:: Bestand of map bestaat niet
* Server denied you to change to the given directory
* Uploaded unaligned file size (0 out of 45 bytes)
* Connection #0 to host 192.168.1.100 left intact
pi@raspberrypi:~ $ 
changed password to xxxx

if there needs to be more info please ask...
is my second script ever i started trough the wiki page so...

greets marco

User avatar
jvdz
Posts: 1316
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Different Backups from Crontab to network

Post by jvdz » Thursday 28 December 2017 23:26

It looks to me that this variable must have the worng path:
DESTDIRNAS="ftp://openmediavault.local/cfs_share02/domoticz_backup" # Path to your Synology NAS backup folder
as it is used in this FTP command:
curl -s --disable-epsv -v -T"/tmp/$BACKUPFILEGZ" -u"$USERNAME:$PASSWORD" "ftp://$SERVER/$DESTDIRNAS"
so the last part: "ftp://$SERVER/$DESTDIRNAS" translates to:
"ftp://192.168.1.100/ftp://openmediavaul ... icz_backup"

Catch my drift? :-)
Jos

astrapowerrr
Posts: 55
Joined: Tuesday 31 January 2017 21:34
Target OS: -
Domoticz version:
Contact:

Re: Different Backups from Crontab to network

Post by astrapowerrr » Friday 29 December 2017 8:28

This script is Copied straight out of the domoticz wiki!!
So it isn’t correct in the wiki I may assume??
I will try to change today and see what happens


Verzonden vanaf mijn iPhone met Tapatalk

astrapowerrr
Posts: 55
Joined: Tuesday 31 January 2017 21:34
Target OS: -
Domoticz version:
Contact:

Re: Different Backups from Crontab to network

Post by astrapowerrr » Friday 29 December 2017 9:15

Hi

Tried with

#!/bin/bash
# LOCAL/FTP/SCP/MAIL PARAMETERS
SERVER="192.168.1.100" # IP of Synology NAS, used for ftp
USERNAME="Marco" # FTP username of Network disk used for ftp
PASSWORD="xxxx" # FTP password of Network disk used for ftp
DESTDIR="/opt/backup" # used for temorarily storage
DESTDIRNAS="ftp://openmediavault.local/cfs_share02/domoticz_backup" # Path to your Synology NAS backup folder
DOMO_IP="192.168.1.101" # Domoticz IP
DOMO_PORT="8080" # Domoticz port
### END OF USER CONFIGURABLE PARAMETERS
TIMESTAMP=`/bin/date +%Y%m%d%H%M%S`
BACKUPFILE="domoticz_$TIMESTAMP.db" # backups will be named "domoticz_YYYYMMDDHHMMSS.db.gz"
BACKUPFILEGZ="$BACKUPFILE".gz
### Create backup and ZIP it
/usr/bin/curl -s http://$DOMO_IP:$DOMO_PORT/backupdatabase.php > /tmp/$BACKUPFILE
gzip -9 /tmp/$BACKUPFILE
tar -zcvf /tmp/domoticz_scripts_$TIMESTAMP.tar.gz /home/pi/domoticz/scripts/
tar -zcvf /tmp/telegram_scripts_$TIMESTAMP.tar.gz /home/pi/tg/scripts/
### Send to Network disk through FTP
curl -s --disable-epsv -v -T"/tmp/$BACKUPFILEGZ" -u"$USERNAME:$PASSWORD" "$DESTDIRNAS"
curl -s --disable-epsv -v -T"/tmp/domoticz_scripts_$TIMESTAMP.tar.gz" -u"$USERNAME:$PASSWORD" "$DESTDIRNAS"
curl -s --disable-epsv -v -T"/tmp/telegram_scripts_$TIMESTAMP.tar.gz" -u"$USERNAME:$PASSWORD" "$DESTDIRNAS"
### Remove temp backup file
/bin/rm /tmp/$BACKUPFILEGZ
/bin/rm /tmp/domoticz_scripts_$TIMESTAMP.tar.gz
/bin/rm /tmp/telegram_scripts_$TIMESTAMP.tar.gz
### Done!

Now I get this error.

pi@raspberrypi:~ $ sudo /home/pi/domoticz/scripts/domoticz_backup.sh
tar: Leidende '/' wordt uit lidnamen weggelaten
/home/pi/domoticz/scripts/
/home/pi/domoticz/scripts/python/
/home/pi/domoticz/scripts/python/googlepubsub.py
/home/pi/domoticz/scripts/python/domoticz.py
/home/pi/domoticz/scripts/python/script_device_PIRsmarter.py
/home/pi/domoticz/scripts/python/reloader.py
/home/pi/domoticz/scripts/python/__pycache__/
/home/pi/domoticz/scripts/python/__pycache__/domoticz.cpython-34.pyc
/home/pi/domoticz/scripts/python/__pycache__/reloader.cpython-34.pyc
/home/pi/domoticz/scripts/python/script_time_demo.py
/home/pi/domoticz/scripts/python/script_device_demo.py
/home/pi/domoticz/scripts/lua_parsers/
/home/pi/domoticz/scripts/lua_parsers/example_json.lua
/home/pi/domoticz/scripts/lua_parsers/example_xml.lua
/home/pi/domoticz/scripts/lua_parsers/example_owm.lua
/home/pi/domoticz/scripts/lua_parsers/example.lua
/home/pi/domoticz/scripts/logrotate/
/home/pi/domoticz/scripts/logrotate/domoticz
/home/pi/domoticz/scripts/readme.txt
/home/pi/domoticz/scripts/buienradar_rain_example.pl
/home/pi/domoticz/scripts/templates/
/home/pi/domoticz/scripts/templates/Device.Lua
/home/pi/domoticz/scripts/templates/All.Lua
/home/pi/domoticz/scripts/templates/global_data.dzVents
/home/pi/domoticz/scripts/templates/Time.Lua
/home/pi/domoticz/scripts/templates/Seurity.dzVents
/home/pi/domoticz/scripts/templates/All.dzVents
/home/pi/domoticz/scripts/templates/UserVariable.dzVents
/home/pi/domoticz/scripts/templates/Device.dzVents
/home/pi/domoticz/scripts/templates/Security.Lua
/home/pi/domoticz/scripts/templates/Bare.dzVents
/home/pi/domoticz/scripts/templates/Timer.dzvents
/home/pi/domoticz/scripts/templates/All.Python
/home/pi/domoticz/scripts/templates/UserVariable.Lua
/home/pi/domoticz/scripts/lua/
/home/pi/domoticz/scripts/lua/JSON.lua
/home/pi/domoticz/scripts/lua/script_device_sensorWU.lua
/home/pi/domoticz/scripts/lua/script_time_demo.lua
/home/pi/domoticz/scripts/lua/script_device_demo.lua
/home/pi/domoticz/scripts/lua/script_time_toonselector.lua
/home/pi/domoticz/scripts/dzVents/
/home/pi/domoticz/scripts/dzVents/data/
/home/pi/domoticz/scripts/dzVents/data/README.md
/home/pi/domoticz/scripts/dzVents/.gitignore
/home/pi/domoticz/scripts/dzVents/documentation/
/home/pi/domoticz/scripts/dzVents/documentation/dzvents-smoothing.png
/home/pi/domoticz/scripts/dzVents/documentation/history.md
/home/pi/domoticz/scripts/dzVents/documentation/README.md
/home/pi/domoticz/scripts/dzVents/documentation/pandoc.md
/home/pi/domoticz/scripts/dzVents/documentation/README.wiki
/home/pi/domoticz/scripts/dzVents/generated_scripts/
/home/pi/domoticz/scripts/dzVents/generated_scripts/README.md
/home/pi/domoticz/scripts/dzVents/runtime/
/home/pi/domoticz/scripts/dzVents/runtime/Device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/temperature_humidity_barometer_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/soilmoisture_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/zone_heating_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/opentherm_gateway_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/scene_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/leafwetness_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/gas_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/p1_smartmeter_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/barometer_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/lux_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/temperature_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/scaleweight_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/group_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/percentage_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/generic_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/ampere_1_phase_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/voltage_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/evohome_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/solar_radiation_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/distance_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/pressure_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/ampere_3_phase_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/security_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/wind_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/zwave_thermostat_mode_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/kodi_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/thermostat_setpoint_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/airquality_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/Adapters.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/custom_sensor_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/alert_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/rain_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/uv_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/temperature_humidity_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/electric_usage_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/waterflow_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/text_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/switch_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/soundlevel_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/kwh_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/visibility_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/counter_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/humidity_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/rgbw_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/Time.lua
/home/pi/domoticz/scripts/dzVents/runtime/todo.md
/home/pi/domoticz/scripts/dzVents/runtime/Domoticz.lua
/home/pi/domoticz/scripts/dzVents/runtime/Utils.lua
/home/pi/domoticz/scripts/dzVents/runtime/TimedCommand.lua
/home/pi/domoticz/scripts/dzVents/runtime/persistence.lua
/home/pi/domoticz/scripts/dzVents/runtime/Variable.lua
/home/pi/domoticz/scripts/dzVents/runtime/dzVents.lua
/home/pi/domoticz/scripts/dzVents/runtime/misc/
/home/pi/domoticz/scripts/dzVents/runtime/misc/smoothing.xlsx
/home/pi/domoticz/scripts/dzVents/runtime/HistoricalStorage.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/testIntegration.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/varString.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/secArmedAway.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/stage1.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/vdSwitchDimmer.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/README.md
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/File.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/global_data.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/stage2.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/
/home/pi/domoticz/scripts/dzVents/runtime/tests/testUtils.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testTime.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/data/
/home/pi/domoticz/scripts/dzVents/runtime/tests/data/README.md
/home/pi/domoticz/scripts/dzVents/runtime/tests/testDevice.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testVariable.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testScriptdzVentsDispatching.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testTimedCommand.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/.luacov
/home/pi/domoticz/scripts/dzVents/runtime/tests/generated_scripts/
/home/pi/domoticz/scripts/dzVents/runtime/tests/generated_scripts/internal1.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/generated_scripts/internal2.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/.f3.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/f1.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/f1lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/f2.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/.f3.lua.swp
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/lua.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/f3.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testEventHelpers.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/tstData.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/README.md
/home/pi/domoticz/scripts/dzVents/runtime/tests/testEventHelpersStorage.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script1.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_wildcard1.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_with_time-contrained_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_timer_classic.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_inactive.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_variable2.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_incomplete_missing_on.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_notable.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script5.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_timer_table.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_variable1.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script6.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_timer_single.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script7.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script3.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script4.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_incomplete_missing_execute.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script2.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_logging.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/global_data.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_security.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_error.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_data.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_variable3.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_with_active_method.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_security_grouped.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_wildcard2.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_combined.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_timer_function.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testfile
/home/pi/domoticz/scripts/dzVents/runtime/tests/devices.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testDomoticz.lua
/home/pi/domoticz/scripts/dzVents/runtime/EventHelpers.lua
/home/pi/domoticz/scripts/dzVents/examples/
/home/pi/domoticz/scripts/dzVents/examples/notify for dead system-alive check devices.lua
/home/pi/domoticz/scripts/dzVents/examples/intruder alert.lua
/home/pi/domoticz/scripts/dzVents/examples/random night light.lua
/home/pi/domoticz/scripts/dzVents/examples/fake presence.lua
/home/pi/domoticz/scripts/dzVents/examples/garage door.lua
/home/pi/domoticz/scripts/dzVents/examples/check dead devices.lua
/home/pi/domoticz/scripts/dzVents/examples/external_light.lua
/home/pi/domoticz/scripts/dzVents/examples/respond to switch.lua
/home/pi/domoticz/scripts/dzVents/examples/check dead devices by desc.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/
/home/pi/domoticz/scripts/dzVents/examples/templates/bare.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/variable.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/complete.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/timer.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/device.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/global_data.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/security.lua
/home/pi/domoticz/scripts/dzVents/examples/check battery levels.lua
/home/pi/domoticz/scripts/dzVents/examples/schedule fish pond pump.lua
/home/pi/domoticz/scripts/dzVents/examples/leak_detection.lua
/home/pi/domoticz/scripts/dzVents/examples/only run script when button pressed.lua
/home/pi/domoticz/scripts/dzVents/examples/calc temp delta.lua
/home/pi/domoticz/scripts/dzVents/examples/simple room heating with hysteresis control.lua
/home/pi/domoticz/scripts/dzVents/examples/get sensor values.lua
/home/pi/domoticz/scripts/dzVents/scripts/
/home/pi/domoticz/scripts/dzVents/scripts/README.md
/home/pi/domoticz/scripts/_domoticz_main.bat
/home/pi/domoticz/scripts/restart_domoticz
/home/pi/domoticz/scripts/_domoticz_main
/home/pi/domoticz/scripts/update_domoticz
/home/pi/domoticz/scripts/script_time_toonselector.lua
/home/pi/domoticz/scripts/download_update.sh
/home/pi/domoticz/scripts/domoticz_backup.sh
tar: Leidende '/' wordt uit lidnamen weggelaten
tar: /home/pi/tg/scripts: Functie stat() is mislukt: Bestand of map bestaat niet
tar: Gestopt in fouttoestand vanwege eerdere fouten
* Hostname was NOT found in DNS cache
* Trying 192.168.1.100...
* Connected to openmediavault.local (192.168.1.100) port 21 (#0)
< 220 ProFTPD 1.3.5 Server ready.
> USER Marco
< 331 Password required for Marco
> PASS xxxx
< 230-Welcome user Marco@192.168.1.101 to 127.0.1.1 FTP server.
< 230-The local time is: Fri Dec 29 08:06:36 2017
< 230 User Marco logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> CWD cfs_share02
* ftp_perform ends with SECONDARY: 0
< 250 CWD command successful
> PASV
* Connect data stream passively
< 227 Entering Passive Mode (192,168,1,100,228,220).
* Hostname was NOT found in DNS cache
* Trying 192.168.1.100...
* Connecting to 192.168.1.100 (192.168.1.100) port 58588
* Connected to openmediavault.local (192.168.1.100) port 21 (#0)
> TYPE I
< 200 Type set to I
> STOR domoticz_backup
< 550 domoticz_backup: Not a regular file
* Failed FTP upload: 550
* Remembering we are in dir "cfs_share02/"
* Uploaded unaligned file size (0 out of 581699 bytes)
* Connection #0 to host openmediavault.local left intact
* Hostname was NOT found in DNS cache
* Trying 192.168.1.100...
* Connected to openmediavault.local (192.168.1.100) port 21 (#0)
< 220 ProFTPD 1.3.5 Server ready.
> USER Marco
< 331 Password required for Marco
> PASS xxxx
< 230-Welcome user Marco@192.168.1.101 to 127.0.1.1 FTP server.
< 230-The local time is: Fri Dec 29 08:06:36 2017
< 230 User Marco logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> CWD cfs_share02
* ftp_perform ends with SECONDARY: 0
< 250 CWD command successful
> PASV
* Connect data stream passively
< 227 Entering Passive Mode (192,168,1,100,229,195).
* Hostname was NOT found in DNS cache
* Trying 192.168.1.100...
* Connecting to 192.168.1.100 (192.168.1.100) port 58819
* Connected to openmediavault.local (192.168.1.100) port 21 (#0)
> TYPE I
< 200 Type set to I
> STOR domoticz_backup
< 550 domoticz_backup: Not a regular file
* Failed FTP upload: 550
* Remembering we are in dir "cfs_share02/"
* Uploaded unaligned file size (0 out of 226385 bytes)
* Connection #0 to host openmediavault.local left intact
* Hostname was NOT found in DNS cache
* Trying 192.168.1.100...
* Connected to openmediavault.local (192.168.1.100) port 21 (#0)
< 220 ProFTPD 1.3.5 Server ready.
> USER Marco
< 331 Password required for Marco
> PASS xxxx
< 230-Welcome user Marco@192.168.1.101 to 127.0.1.1 FTP server.
< 230-The local time is: Fri Dec 29 08:06:36 2017
< 230 User Marco logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> CWD cfs_share02
* ftp_perform ends with SECONDARY: 0
< 250 CWD command successful
> PASV
* Connect data stream passively
< 227 Entering Passive Mode (192,168,1,100,227,101).
* Hostname was NOT found in DNS cache
* Trying 192.168.1.100...
* Connecting to 192.168.1.100 (192.168.1.100) port 58213
* Connected to openmediavault.local (192.168.1.100) port 21 (#0)
> TYPE I
< 200 Type set to I
> STOR domoticz_backup
< 550 domoticz_backup: Not a regular file
* Failed FTP upload: 550
* Remembering we are in dir "cfs_share02/"
* Uploaded unaligned file size (0 out of 45 bytes)
* Connection #0 to host openmediavault.local left intact


ImageImageImage



Verzonden vanaf mijn iPhone met Tapatalk

User avatar
Derik
Posts: 2097
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Different Backups from Crontab to network

Post by Derik » Friday 29 December 2017 11:56

mmm: i see 100 and 101 for domoticz ip?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups

User avatar
jvdz
Posts: 1316
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Different Backups from Crontab to network

Post by jvdz » Friday 29 December 2017 12:37

Couple of things here:
It looks like this directory doesn't exists:

Code: Select all

tar -zcvf /tmp/telegram_scripts_$TIMESTAMP.tar.gz /home/pi/tg/scripts/
tar: Leidende '/' wordt uit lidnamen weggelaten
tar: /home/pi/tg/scripts: Functie stat() is mislukt: Bestand of map bestaat niet
tar: Gestopt in fouttoestand vanwege eerdere fouten
These errors likely come from the fact that the target directory doesn't end with a slash (/):

Code: Select all

> STOR domoticz_backup
< 550 domoticz_backup: Not a regular file
* Failed FTP upload: 550
* Remembering we are in dir "cfs_share02/"
So this line should be:

Code: Select all

DESTDIRNAS="ftp://openmediavault.local/cfs_share02/domoticz_backup/" # Path to your Synology NAS backup folder
Jos

astrapowerrr
Posts: 55
Joined: Tuesday 31 January 2017 21:34
Target OS: -
Domoticz version:
Contact:

Re: Different Backups from Crontab to network

Post by astrapowerrr » Friday 29 December 2017 14:22

So this should be correct now?

i@raspberrypi:~ $ sudo /home/pi/domoticz/scripts/domoticz_backup.sh
tar: Leidende '/' wordt uit lidnamen weggelaten
/home/pi/domoticz/scripts/
/home/pi/domoticz/scripts/python/
/home/pi/domoticz/scripts/python/googlepubsub.py
/home/pi/domoticz/scripts/python/domoticz.py
/home/pi/domoticz/scripts/python/script_device_PIRsmarter.py
/home/pi/domoticz/scripts/python/reloader.py
/home/pi/domoticz/scripts/python/__pycache__/
/home/pi/domoticz/scripts/python/__pycache__/domoticz.cpython-34.pyc
/home/pi/domoticz/scripts/python/__pycache__/reloader.cpython-34.pyc
/home/pi/domoticz/scripts/python/script_time_demo.py
/home/pi/domoticz/scripts/python/script_device_demo.py
/home/pi/domoticz/scripts/lua_parsers/
/home/pi/domoticz/scripts/lua_parsers/example_json.lua
/home/pi/domoticz/scripts/lua_parsers/example_xml.lua
/home/pi/domoticz/scripts/lua_parsers/example_owm.lua
/home/pi/domoticz/scripts/lua_parsers/example.lua
/home/pi/domoticz/scripts/logrotate/
/home/pi/domoticz/scripts/logrotate/domoticz
/home/pi/domoticz/scripts/readme.txt
/home/pi/domoticz/scripts/buienradar_rain_example.pl
/home/pi/domoticz/scripts/templates/
/home/pi/domoticz/scripts/templates/Device.Lua
/home/pi/domoticz/scripts/templates/All.Lua
/home/pi/domoticz/scripts/templates/global_data.dzVents
/home/pi/domoticz/scripts/templates/Time.Lua
/home/pi/domoticz/scripts/templates/Seurity.dzVents
/home/pi/domoticz/scripts/templates/All.dzVents
/home/pi/domoticz/scripts/templates/UserVariable.dzVents
/home/pi/domoticz/scripts/templates/Device.dzVents
/home/pi/domoticz/scripts/templates/Security.Lua
/home/pi/domoticz/scripts/templates/Bare.dzVents
/home/pi/domoticz/scripts/templates/Timer.dzvents
/home/pi/domoticz/scripts/templates/All.Python
/home/pi/domoticz/scripts/templates/UserVariable.Lua
/home/pi/domoticz/scripts/lua/
/home/pi/domoticz/scripts/lua/JSON.lua
/home/pi/domoticz/scripts/lua/script_device_sensorWU.lua
/home/pi/domoticz/scripts/lua/script_time_demo.lua
/home/pi/domoticz/scripts/lua/script_device_demo.lua
/home/pi/domoticz/scripts/lua/script_time_toonselector.lua
/home/pi/domoticz/scripts/dzVents/
/home/pi/domoticz/scripts/dzVents/data/
/home/pi/domoticz/scripts/dzVents/data/README.md
/home/pi/domoticz/scripts/dzVents/.gitignore
/home/pi/domoticz/scripts/dzVents/documentation/
/home/pi/domoticz/scripts/dzVents/documentation/dzvents-smoothing.png
/home/pi/domoticz/scripts/dzVents/documentation/history.md
/home/pi/domoticz/scripts/dzVents/documentation/README.md
/home/pi/domoticz/scripts/dzVents/documentation/pandoc.md
/home/pi/domoticz/scripts/dzVents/documentation/README.wiki
/home/pi/domoticz/scripts/dzVents/generated_scripts/
/home/pi/domoticz/scripts/dzVents/generated_scripts/README.md
/home/pi/domoticz/scripts/dzVents/runtime/
/home/pi/domoticz/scripts/dzVents/runtime/Device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/temperature_humidity_barometer_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/soilmoisture_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/zone_heating_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/opentherm_gateway_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/scene_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/leafwetness_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/gas_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/p1_smartmeter_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/barometer_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/lux_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/temperature_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/scaleweight_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/group_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/percentage_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/generic_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/ampere_1_phase_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/voltage_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/evohome_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/solar_radiation_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/distance_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/pressure_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/ampere_3_phase_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/security_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/wind_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/zwave_thermostat_mode_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/kodi_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/thermostat_setpoint_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/airquality_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/Adapters.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/custom_sensor_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/alert_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/rain_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/uv_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/temperature_humidity_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/electric_usage_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/waterflow_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/text_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/switch_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/soundlevel_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/kwh_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/visibility_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/counter_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/humidity_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/device-adapters/rgbw_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/Time.lua
/home/pi/domoticz/scripts/dzVents/runtime/todo.md
/home/pi/domoticz/scripts/dzVents/runtime/Domoticz.lua
/home/pi/domoticz/scripts/dzVents/runtime/Utils.lua
/home/pi/domoticz/scripts/dzVents/runtime/TimedCommand.lua
/home/pi/domoticz/scripts/dzVents/runtime/persistence.lua
/home/pi/domoticz/scripts/dzVents/runtime/Variable.lua
/home/pi/domoticz/scripts/dzVents/runtime/dzVents.lua
/home/pi/domoticz/scripts/dzVents/runtime/misc/
/home/pi/domoticz/scripts/dzVents/runtime/misc/smoothing.xlsx
/home/pi/domoticz/scripts/dzVents/runtime/HistoricalStorage.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/testIntegration.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/varString.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/secArmedAway.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/stage1.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/vdSwitchDimmer.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/README.md
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/File.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/global_data.lua
/home/pi/domoticz/scripts/dzVents/runtime/integration-tests/stage2.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/
/home/pi/domoticz/scripts/dzVents/runtime/tests/testUtils.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testTime.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/data/
/home/pi/domoticz/scripts/dzVents/runtime/tests/data/README.md
/home/pi/domoticz/scripts/dzVents/runtime/tests/testDevice.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testVariable.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testScriptdzVentsDispatching.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testTimedCommand.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/.luacov
/home/pi/domoticz/scripts/dzVents/runtime/tests/generated_scripts/
/home/pi/domoticz/scripts/dzVents/runtime/tests/generated_scripts/internal1.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/generated_scripts/internal2.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/.f3.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/f1.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/f1lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/f2.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/.f3.lua.swp
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/lua.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scandir/f3.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testEventHelpers.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/tstData.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/README.md
/home/pi/domoticz/scripts/dzVents/runtime/tests/testEventHelpersStorage.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script1.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_wildcard1.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_with_time-contrained_device.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_timer_classic.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_inactive.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_variable2.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_incomplete_missing_on.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_notable.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script5.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_timer_table.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_variable1.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script6.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_timer_single.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script7.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script3.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script4.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_incomplete_missing_execute.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script2.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_logging.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/global_data.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_security.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_error.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_data.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_variable3.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_with_active_method.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_security_grouped.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_wildcard2.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_combined.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/scripts/script_timer_function.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testfile
/home/pi/domoticz/scripts/dzVents/runtime/tests/devices.lua
/home/pi/domoticz/scripts/dzVents/runtime/tests/testDomoticz.lua
/home/pi/domoticz/scripts/dzVents/runtime/EventHelpers.lua
/home/pi/domoticz/scripts/dzVents/examples/
/home/pi/domoticz/scripts/dzVents/examples/notify for dead system-alive check devices.lua
/home/pi/domoticz/scripts/dzVents/examples/intruder alert.lua
/home/pi/domoticz/scripts/dzVents/examples/random night light.lua
/home/pi/domoticz/scripts/dzVents/examples/fake presence.lua
/home/pi/domoticz/scripts/dzVents/examples/garage door.lua
/home/pi/domoticz/scripts/dzVents/examples/check dead devices.lua
/home/pi/domoticz/scripts/dzVents/examples/external_light.lua
/home/pi/domoticz/scripts/dzVents/examples/respond to switch.lua
/home/pi/domoticz/scripts/dzVents/examples/check dead devices by desc.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/
/home/pi/domoticz/scripts/dzVents/examples/templates/bare.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/variable.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/complete.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/timer.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/device.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/global_data.lua
/home/pi/domoticz/scripts/dzVents/examples/templates/security.lua
/home/pi/domoticz/scripts/dzVents/examples/check battery levels.lua
/home/pi/domoticz/scripts/dzVents/examples/schedule fish pond pump.lua
/home/pi/domoticz/scripts/dzVents/examples/leak_detection.lua
/home/pi/domoticz/scripts/dzVents/examples/only run script when button pressed.lua
/home/pi/domoticz/scripts/dzVents/examples/calc temp delta.lua
/home/pi/domoticz/scripts/dzVents/examples/simple room heating with hysteresis control.lua
/home/pi/domoticz/scripts/dzVents/examples/get sensor values.lua
/home/pi/domoticz/scripts/dzVents/scripts/
/home/pi/domoticz/scripts/dzVents/scripts/README.md
/home/pi/domoticz/scripts/_domoticz_main.bat
/home/pi/domoticz/scripts/restart_domoticz
/home/pi/domoticz/scripts/_domoticz_main
/home/pi/domoticz/scripts/update_domoticz
/home/pi/domoticz/scripts/script_time_toonselector.lua
/home/pi/domoticz/scripts/download_update.sh
/home/pi/domoticz/scripts/domoticz_backup.sh
* Hostname was NOT found in DNS cache
* Trying 192.168.1.100...
* Connected to openmediavault.local (192.168.1.100) port 21 (#0)
< 220 ProFTPD 1.3.5 Server ready.
> USER Marco
< 331 Password required for Marco
> PASS xxxx
< 230-Welcome user Marco@192.168.1.101 to 127.0.1.1 FTP server.
< 230-The local time is: Fri Dec 29 13:19:43 2017
< 230 User Marco logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> CWD cfs_share02
* ftp_perform ends with SECONDARY: 0
< 250 CWD command successful
> CWD domoticz_backup
< 250 CWD command successful
> PASV
* Connect data stream passively
< 227 Entering Passive Mode (192,168,1,100,226,240).
* Hostname was NOT found in DNS cache
* Trying 192.168.1.100...
* Connecting to 192.168.1.100 (192.168.1.100) port 58096
* Connected to openmediavault.local (192.168.1.100) port 21 (#0)
> TYPE I
< 200 Type set to I
> STOR domoticz_20171229131837.db.gz
< 150 Opening BINARY mode data connection for domoticz_20171229131837.db.gz
} [data not shown]
* We are completely uploaded and fine
* Remembering we are in dir "cfs_share02/domoticz_backup/"
< 226 Transfer complete
* Connection #0 to host openmediavault.local left intact
* Hostname was NOT found in DNS cache
* Trying 192.168.1.100...
* Connected to openmediavault.local (192.168.1.100) port 21 (#0)
< 220 ProFTPD 1.3.5 Server ready.
> USER Marco
< 331 Password required for Marco
> PASS xxxx
< 230-Welcome user Marco@192.168.1.101 to 127.0.1.1 FTP server.
< 230-The local time is: Fri Dec 29 13:19:44 2017
< 230 User Marco logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> CWD cfs_share02
* ftp_perform ends with SECONDARY: 0
< 250 CWD command successful
> CWD domoticz_backup
< 250 CWD command successful
> PASV
* Connect data stream passively
< 227 Entering Passive Mode (192,168,1,100,201,214).
* Hostname was NOT found in DNS cache
* Trying 192.168.1.100...
* Connecting to 192.168.1.100 (192.168.1.100) port 51670
* Connected to openmediavault.local (192.168.1.100) port 21 (#0)
> TYPE I
< 200 Type set to I
> STOR domoticz_scripts_20171229131837.tar.gz
< 150 Opening BINARY mode data connection for domoticz_scripts_20171229131837.tar.gz
} [data not shown]
* We are completely uploaded and fine
* Remembering we are in dir "cfs_share02/domoticz_backup/"
< 226 Transfer complete
* Connection #0 to host openmediavault.local left intact



Verzonden vanaf mijn iPhone met Tapatalk

User avatar
jvdz
Posts: 1316
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Different Backups from Crontab to network

Post by jvdz » Friday 29 December 2017 14:30

astrapowerrr wrote:
Friday 29 December 2017 14:22
So this should be correct now?

i@raspberrypi:~ $ sudo /home/pi/domoticz/scripts/domoticz_backup.sh
tar: Leidende '/' wordt uit lidnamen weggelaten
/home/pi/domoticz/scripts/
-snip-
/home/pi/domoticz/scripts/domoticz_backup.sh
* Hostname was NOT found in DNS cache
* Trying 192.168.1.100...
* Connected to openmediavault.local (192.168.1.100) port 21 (#0)
< 220 ProFTPD 1.3.5 Server ready.
> USER Marco
-snip-
< 200 Type set to I
> STOR domoticz_20171229131837.db.gz
< 150 Opening BINARY mode data connection for domoticz_20171229131837.db.gz
} [data not shown]
* We are completely uploaded and fine
* Remembering we are in dir "cfs_share02/domoticz_backup/"
< 226 Transfer complete
* Connection #0 to host openmediavault.local left intact
* Hostname was NOT found in DNS cache
* Trying 192.168.1.100...
* Connected to openmediavault.local (192.168.1.100) port 21 (#0)
< 220 ProFTPD 1.3.5 Server ready.
> USER Marco
-snip-
> TYPE I
< 200 Type set to I
> STOR domoticz_scripts_20171229131837.tar.gz
< 150 Opening BINARY mode data connection for domoticz_scripts_20171229131837.tar.gz
} [data not shown]
* We are completely uploaded and fine
* Remembering we are in dir "cfs_share02/domoticz_backup/"
< 226 Transfer complete
* Connection #0 to host openmediavault.local left intact

Verzonden vanaf mijn iPhone met Tapatalk
Think your are the only one that can confirm whether it worked fine by checking the NAS, but the log states it successfully uploaded 2 files. ;)

Jos

astrapowerrr
Posts: 55
Joined: Tuesday 31 January 2017 21:34
Target OS: -
Domoticz version:
Contact:

Re: Different Backups from Crontab to network

Post by astrapowerrr » Friday 29 December 2017 14:40

I can confirm that is is sending files to the nas!!
so i am happy! yeejj

thanks all for the good help here!
and a happy 2018...!!

Erwin92
Posts: 14
Joined: Saturday 26 November 2016 20:30
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Different Backups from Crontab to network

Post by Erwin92 » Friday 19 January 2018 14:07

Hi everyone,

I'm using the back-up script for a few months now, to make a back-up of domoticz every night a send it to my nas.
Making the back-up, and put it on the nas works fine, but I received a error with the extension of automated pruning.

The error occurred says line 46: dirlist: acces denied.
Schermafbeelding 2018-01-19 om 13.04.50.png
Schermafbeelding 2018-01-19 om 13.04.50.png (18.95 KiB) Viewed 1120 times
But the domoticz user, has full rights for acces the directory.
Schermafbeelding 2018-01-19 om 13.06.00.png
Schermafbeelding 2018-01-19 om 13.06.00.png (58.21 KiB) Viewed 1120 times
Can someone help me?
Attachments
Schermafbeelding 2018-01-19 om 13.06.00.png
Schermafbeelding 2018-01-19 om 13.06.00.png (58.21 KiB) Viewed 1120 times

dennis075
Posts: 2
Joined: Saturday 20 January 2018 13:05
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Different Backups from Crontab to network

Post by dennis075 » Saturday 20 January 2018 13:18

Hello all,

First time here on the forum so feedback is welcome if you are missing information :).
I want to use the backup function since my SD card went corrupt a few days ago. Starting all over but first want to have a decent backup just in case..
Now I have a problem with the backup script from the wiki. Code is:

Code: Select all

#!/bin/bash

    ## LOCAL/FTP/SCP/MAIL PARAMETERS
    SERVER="ftp://192.168.1.150:21"         # IP of Network disk, used for: ftp mail scp
    USERNAME="xx"         # FTP username of Network disk used for: ftp mail scp
    PASSWORD="xx"               # FTP password of Network disk used for: ftp mail scp
    DESTDIR="/opt/backup"      # used for: local
    DOMO_IP="192.168.1.22"      # 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_$TIMESTAMP.tar.gz" # Change the xxx to yours
 
    ### Create backup and ZIP it
    tar -zcvf /tmp/$BACKUPFILEDIR /home/pi/domoticz/scripts/   # 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://192.168.1.150/Dennis/Backup/RPi/domoticz/"  # Change the ftp to yours !!!
                                                    
    ### Remove temp backup file
    /bin/rm /tmp/$BACKUPFILEDIR

    ### Done!]
where xx is replaced ofcourse. When running the script I got the following error:

* Trying 192.168.1.150...
* TCP_NODELAY set
* Connected to 192.168.1.150 (192.168.1.150) port 21 (#0)
< 220 ProFTPD 1.3.4a Server (ProFTPD) [46.129.119.45]
> USER xx
< 331 Password required for admin
> PASS xx
< 230 User admin logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> CWD Dennis
* ftp_perform ends with SECONDARY: 0
< 250 CWD command successful
> CWD Backup
< 250 CWD command successful
> CWD RPi
< 250 CWD command successful
> CWD domoticz
< 250 CWD command successful
> PASV
* Connect data stream passively
< 227 Entering Passive Mode (46,129,119,45,217,4).
* Trying 46.129.119.45...
* TCP_NODELAY set
* Connecting to 46.129.119.45 (46.129.119.45) port 55556
* connect to 46.129.119.45 port 21 failed: Connection timed out
* Failed to connect to 192.168.1.150 port 21: Connection timed out
* Closing connection 0

The only thing I see is the IP adress from proftpd looks like an external adress. Any suggestions to fix this?

jerry
Posts: 2
Joined: Saturday 04 November 2017 13:19
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Different Backups from Crontab to network

Post by jerry » Monday 26 February 2018 22:03

Have you tried my solution? Simply write backups to a fileshare on your NAS:

viewtopic.php?f=63&t=20229

Works like a charm. No FTP needed.

User avatar
jannl
Posts: 955
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Geleen
Contact:

Re: Different Backups from Crontab to network

Post by jannl » Thursday 01 March 2018 8:27

I recently saw the same error on this forum. It has something to do withe the active passive setting of ftp. Please search.

DAVIZINHO
Posts: 142
Joined: Sunday 27 August 2017 18:00
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Spain
Contact:

Re: Different Backups from Crontab to network

Post by DAVIZINHO » Saturday 19 May 2018 16:56

hello.
I use this method and works great. i make a backup of various folders in my nas, every day

The problem for me is in the part of script to delete de files with XX days:

# get directory listing from remote source
echo "
cd $putdir
ls -l
"|$ftpsite >dirlist

the return to me:
Host key verification failed.
Couldn't read packet: Connection reset by peer

any idea?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest