Point automatic backup to NAS?

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
manjh
Posts: 749
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Point automatic backup to NAS?

Post by manjh »

I'm sure this must have been discussed before, but I can't find it.

The automatic backup feature in Domoticz will create backups on hourly, daily and monthly level on the SD card of the R-Pi. I have seen several solutions to copy this onto a NAS periodically, but I would much rather write these backups straight to a mounted NAS.
Where can I change the write path of Domoticz?
Hans
manjh
Posts: 749
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Point automatic backup to NAS?

Post by manjh »

No ideas, anyone? I can't believe this is "impossible"... :shock:
Hans
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Point automatic backup to NAS?

Post by waaren »

manjh wrote: Monday 04 March 2019 21:04 No ideas, anyone? I can't believe this is "impossible"... :shock:
One idea is to mount a NAS directory on your system and create a symbolic link from the domoticz/backups directory.
Another idea is to use berryboot or something similar to only bootstrap from your SD and route all IO to/from NAS.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
zenit
Posts: 17
Joined: Wednesday 25 March 2015 17:40
Target OS: Linux
Domoticz version: Beta
Location: Berg aan de Maas
Contact:

Re: Point automatic backup to NAS?

Post by zenit »

Hi,

Maybe you could check the wiki...

https://www.domoticz.com/wiki/Daily_bac ... ternal_hdd

There are examples of backing up your database and folders (scripts).
manjh
Posts: 749
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Point automatic backup to NAS?

Post by manjh »

zenit wrote: Tuesday 05 March 2019 6:37 Hi,

Maybe you could check the wiki...

https://www.domoticz.com/wiki/Daily_bac ... ternal_hdd

There are examples of backing up your database and folders (scripts).
Yes, I did see that, but I don't want the backups to be written on SD in the first place. All of these examples simply copy the files from SD to NAS.
Hans
manjh
Posts: 749
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Point automatic backup to NAS?

Post by manjh »

waaren wrote: Monday 04 March 2019 21:53
manjh wrote: Monday 04 March 2019 21:04 No ideas, anyone? I can't believe this is "impossible"... :shock:
One idea is to mount a NAS directory on your system and create a symbolic link from the domoticz/backups directory.
Another idea is to use berryboot or something similar to only bootstrap from your SD and route all IO to/from NAS.
Looks like this is what I need. Hmmm... SymLink. Learning every day. ;)
Hans
manjh
Posts: 749
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Point automatic backup to NAS?

Post by manjh »

manjh wrote: Sunday 10 March 2019 18:20
waaren wrote: Monday 04 March 2019 21:53
manjh wrote: Monday 04 March 2019 21:04 No ideas, anyone? I can't believe this is "impossible"... :shock:
One idea is to mount a NAS directory on your system and create a symbolic link from the domoticz/backups directory.
Another idea is to use berryboot or something similar to only bootstrap from your SD and route all IO to/from NAS.
Looks like this is what I need. Hmmm... SymLink. Learning every day. ;)
Implemented, and works like a charm. This is exactly what I was looking for!
Hans
Segfault
Posts: 28
Joined: Friday 04 January 2019 18:22
Target OS: Linux
Domoticz version: GIT
Contact:

Re: Point automatic backup to NAS?

Post by Segfault »

Is there a variable somewhere or this path ~/backups is hardcoded and requires patching and recompiling? (This was the question of the OP, no answer so far?)
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Point automatic backup to NAS?

Post by waaren »

Segfault wrote:Is there a variable somewhere or this path ~/backups is hardcoded and requires patching and recompiling? (This was the question of the OP, no answer so far?)
The path is hardcoded.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Segfault
Posts: 28
Joined: Friday 04 January 2019 18:22
Target OS: Linux
Domoticz version: GIT
Contact:

Re: Point automatic backup to NAS?

Post by Segfault »

Thanks for reply.
Now comes another issue. Why is the database owned by root (running RPi installation)? There is no real reason domoticz should run as root, it is against all good Unix principles. For instance, I'd like to put the whole /home/domoticz into a NFS share, I have several users with home on NFS. And of course, I can't, because root has no business making remote connections and remote root ownership cannot be accepted by NFS server for security reasons. The server runs RAIDZ-2 array and there are backup policies in place. Using NFS home would resolve all my backup problems and would reduce writes on USB stick.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest