jejje / pihole-rsync Goto Github PK
View Code? Open in Web Editor NEWSetting up a sync between two PiHole for Failover
Setting up a sync between two PiHole for Failover
Hi, this is interesting and seems quite simple - thank you for sharing.
When I set this up unfortunately I get a permissions denied error when I run this - any ideas on what am I doing wrong?
Here is what I get when manually running this from the 'master pihole' to the secondary one.
pi@pi-server2:/etc/pihole $ sudo ./pi_rsync.sh -s
Syncing {gravity.db} over to {192.168.10.66}...
rsync: mkstemp "/etc/pihole/.gravity.db.UBI39Q" failed: Permission denied (13)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1207) [sender=3.1.3]
Syncing {custom.list} over to {192.168.10.66}...
rsync: mkstemp "/etc/pihole/.custom.list.qWKIPL" failed: Permission denied (13)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1207) [sender=3.1.3]
Syncing {dhcp.leases} over to {192.168.10.66}...
rsync: mkstemp "/etc/pihole/.dhcp.leases.bn9i35" failed: Permission denied (13)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1207) [sender=3.1.3]
Syncing {local.list} over to {192.168.10.66}...
rsync: mkstemp "/etc/pihole/.local.list.vwgcSi" failed: Permission denied (13)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1207) [sender=3.1.3]
Running command pihole -g on {192.168.10.66}
Thanks.
I was wondering if we really needed the pihole -g
command?
As we rsync the whole DB, I think that a simple stop / restart / reload list would be enough, or am I wrong?
Other than that, your script is simple and do all I need. Thanks for that :-)
Oh, and the crontab you create within the script indicates /etc/pi_rsynch.sh ; I edited it as it should be /etc/pihole/pi_rsynch.sh
:-)
Originally posted by @Damien514 in #2 (comment)
I guess this is a feature request.
I would like to also sync my dhcp static leases.
I did solve this for me but not cleanly as my script writing skills are non existant.
I copied the script to /etc/dnsmasq.d/pi_rsycdhcp.sh
Then I edited it to sync 04-pihole-static-dhcp.conf (your name may be different)
and changed any directory /etc/pihole/ to /etc/dnsmasq.d/
Ran it and it worked.
It would be great if this could all be one script.
Awesome script way easier than setting up containers to run a separate program.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.