To be safe not to harm the database, that effort needs to make a backup of domoticz.db
Waaren's proposal applies an approach in which all setup-elements can be manipulated.
Have 'squeezed' that to the following basic scriptline
Code: Select all
sudo /usr/bin/sqlite3 /home/pi/domoticz/domoticz.db ".backup ./tmp"
With slight variation, it throws an error
Code: Select all
sudo /usr/bin/sqlite3 /home/pi/domoticz/domoticz.db ".backup /tmp"
Error: cannot open "/tmp"
Scriptline seems correct, but apparently some subtle error in the scriptline.
Assistance appreciated to correct, or to find alternative with same functional result!
Side-remark
Studying this approach, for starters it is OK to make in this way a copy of the database before manipulation, but for future continuous use it seems prudent to direct the periodic backup to RAMFilingSystem, to reduce wear&tear on RPI's SD-card.