Hi, Love Domoticz and I am working on a big system for a campsite. Gone controll >50 rooms and lots of other things.
But I want everything to be backedup if for example a thunderstorm wipes out my rpi/sdcard.
I have domoticz doing database backups, and then I have a tar script making a backup of my entire /home/pi folder for smooth restoration. The rpi also uploads the backups to dropbox for safe keeping.
But I have one problem. I would like to add the domoticz version number into the filename of the backupfile. To easy be able to identify and download the correct version if restoration is needed.
I found that in the History.txt in domoticz folder the first line states the current version like this.
Version 3.4834 (March 2nd 2016)
So I have been trying to take this and add it into the filename but without sucess. So I was thinking maby someone have a solution?
add Domoticz version number to textfile name
Moderators: leecollings, remb0
-
- Posts: 10
- Joined: Sunday 25 January 2015 16:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: add Domoticz version number to textfile name
Why not just use a date/time stamp in your filename?
I think it's easier to know to what date you want to revert than to what version.
I think it's easier to know to what date you want to revert than to what version.
-
- Posts: 10
- Joined: Sunday 25 January 2015 16:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: add Domoticz version number to textfile name
Hi, I allredy do that ofc. And for just reverting to a stable version when somethings is not working that is enough.
But if the lightning takes out all hardware I will need to know what version was used (might not have been updated in a year or more), so that I can get the same version image with the same debian karnell versions and so forth. To make sure that the backup is 100% compatible.
But if the lightning takes out all hardware I will need to know what version was used (might not have been updated in a year or more), so that I can get the same version image with the same debian karnell versions and so forth. To make sure that the backup is 100% compatible.
-
- Posts: 10
- Joined: Sunday 25 January 2015 16:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: add Domoticz version number to textfile name
Awsome! Thanks. Just what I needed!
Working great
Working great
Re: add Domoticz version number to textfile name
You can get the current version of the running Domoticz via:
In bash, you can store this versionnumber in a variable via curl:
Code: Select all
http://<ip>:<port>/json.htm?type=command¶m=getversion
Code: Select all
#Retrieve current Domoticz versionnumber
json=`curl -s -X GET "http://<ip>:<port>/json.htm?type=command¶m=getversion"`
version=$(echo $json |grep -Po '(?<="version" : ")[^"]*')
-
- Posts: 38
- Joined: Friday 27 December 2013 3:13
- Target OS: Linux
- Domoticz version: Beta
- Location: Friesland
- Contact:
Re: add Domoticz version number to textfile name
Another solution I use in my upgrade script:
Code: Select all
TIMESTAMP=`/bin/date +%Y-%m-%d-%H%M`
VERSION=`cat /mnt/GrabnGo_2TB/peter/domoticz/appversion.h.txt | grep "#define APPVERSION " | cut -c20-`
BACKUPFILE="/mnt/GrabnGo_2TB/peter/Domoticz_${TIMESTAMP}_${VERSION}.tar.gz"
echo "Makket Backup fan /mnt/GrabnGo_2TB/peter/domoticz nei $BACKUPFILE"
tar cPzf $BACKUPFILE /mnt/GrabnGo_2TB/peter/domoticz; #tar xpvzf "Domoticz_$TIMESTAMP.tar.gz"
Who is online
Users browsing this forum: No registered users and 1 guest