user specific database filename for export

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.
Post Reply
poudenes
Posts: 545
Joined: Wednesday 08 March 2017 10:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

user specific database filename for export

Post by poudenes » Thursday 31 May 2018 11:21

hi All,

When i update to a later beta i always create a backup of the database. (I know it also backup automatic when you enable it) But want always the last recent information.

Maybe a idea to let users made a custom filename that will used when you backup a database for example:

database-versionnumber-date : database-v3.9462-31-05-2018.db

Create some pull down menu's where you have some pre configured options. and maybe 1 open field for user custom text

cheers,
Peter
RPi3 with OSMC - RPi3 with Domoticz - Dashticz - MiLight - Nanolead Aurora - KaKu - Logitech Hamony - Nest - RFLink

User avatar
Egregius
Posts: 2715
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: Beta
Location: Beitem, BE
Contact:

Re: user specific database filename for export

Post by Egregius » Thursday 31 May 2018 12:14

Is it that hard to rename the file that is downloaded during the backup?
Besides that, I never had a database issue with updates. I just rely on my daily backup for wurst case scenario's.

poudenes
Posts: 545
Joined: Wednesday 08 March 2017 10:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: user specific database filename for export

Post by poudenes » Thursday 31 May 2018 17:45

its just a suggestion... :mrgreen:
And domoticz is automation so why we don't automate this... haha
RPi3 with OSMC - RPi3 with Domoticz - Dashticz - MiLight - Nanolead Aurora - KaKu - Logitech Hamony - Nest - RFLink

niki_lauda
Posts: 137
Joined: Saturday 31 August 2013 14:48
Target OS: Raspberry Pi
Domoticz version: beta
Location: Eindhoven (NL)
Contact:

Re: user specific database filename for export

Post by niki_lauda » Thursday 31 May 2018 21:36

poudenes wrote:
Thursday 31 May 2018 11:21
hi All,

When i update to a later beta i always create a backup of the database. (I know it also backup automatic when you enable it) But want always the last recent information.

Maybe a idea to let users made a custom filename that will used when you backup a database for example:

database-versionnumber-date : database-v3.9462-31-05-2018.db

Create some pull down menu's where you have some pre configured options. and maybe 1 open field for user custom text

cheers,
Peter
There is a script that does the job. I made a dummy button that kicks off a script that saves the database on en different location. You can FTP it, I just store it on a shared disk. It runs at 03:00 and at 14:00 hour.
Here was an other post http://www.domoticz.com/forum/viewtopic ... RS#p111150

Code: Select all

#!/bin/bash
    # LOCAL/FTP/SCP/MAIL PARAMETERS
    SERVER="10.0.X.X"   # IP of Network disk, used for ftp
    USERNAME="XX"         # FTP username of Network disk used for ftp
    PASSWORD="XXXXXXXXX"         # FTP password of Network disk used for ftp
    DESTDIR="/opt/backup"   # used for temorarily storage
    DOMO_IP="10.0.X.X"  # 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://127.0.0.1:8080/backupdatabase.php > /mnt/nas20/$BACKUPFILE
    gzip -9 /mnt/nas20/$BACKUPFILE
    ### Send to Network disk through FTP
    ### curl -s --disable-epsv -v -T"/tmp/$BACKUPFILEGZ" -u"$USERNAME:$PASSWORD" "ftp://$SERVER"
    ### Remove temp backup file
    ###/bin/rm /tmp/$BACKUPFILEGZ
    ### Done!

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests