Automated Backups of Pi-hole

I've used Pi-hole for a while now and have been really enjoying it, so much so that it inspired me to make my own version of it using NodeJS for my final year project at University, last year! It was no where near as good as Pi-hole, but fun to develop nonetheless.

As the title suggests, are any of you using, or know of, an automated system for backing up just your Pi-hole configuration data (rather than the whole disk or container)? The Teleporter tool exports and imports a great set of data, but I haven't found a way to schedule an export and backup that data to S3 or elsewhere.

Thanks guys :slight_smile:

pihole -a -t via cron?

https://docs.pi-hole.net/core/pihole-command/
"Create a configuration backup. The backup will be created in the directory from which the command is run. The backup can be imported using the Settings > Teleport page."

1 Like

You're spot on with using the pihole -a -t command with cron, that would save all the right data and solve the scheduling portion of it.

There are a couple downsides though, you'd have to write a pretty hefty script if you wanted to replicate your backups and have some kind of monitoring. In my experience, a cron job will work great for a while, then it starts to silently fail, and then you don't have an up-to-date backup when the worst happens :sweat_smile:

1 Like

Ive not really got much runing on my Pi except for pihole/unbound & etherwake ... not sure if you have a synology nas?
I use the free "active backup for server" program on my synology NAS which backs the folders on my pi via SSH on schedule and supports versioning/retention etc... you can then use any of the other synology apps to sync these to glacier/s3/syncthing/ftp or whetever other app else is available and email/notifications.

Also from time to time (before any major updates or changes i do a full image backup of the SD card using macrium reflect

1 Like

That's a pretty cool setup with the Synology NAS, unfortunately I don't have one, so I'd be looking for a separate service online that I could connect to my installation

Thanks for telling me how you sort your backups!

1 Like

That is unusual. If you are experiencing this, then a confirmation message or email with each cron event may be warranted.

As an example, Pi-hole runs a weekly cron to rebuild gravity. In my experience over 4 years on multiple Pi-Holes, this script has never failed.

2 Likes

Hey jfb, I should have elaborated on what I meant; a cron job that has one dependency will work fine for many years.
I was thinking that, if I were to write my own script that used Teleporter, then moved the backup, and monitored it, that's a lot more points of failure for a cron job. I also like the idea of a third party service facilitating the backup and storing the backups on disks or services that I have control of :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.