Last active
October 26, 2024 20:38
-
-
Save stoneobscurity/21261fabb5b4381d360219088210bb43 to your computer and use it in GitHub Desktop.
automatic backups of Pi-Hole (docker), see comments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd /backup && pihole -a -t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
docker exec pihole-container-name /backup/backup.sh | |
rsync -avrg /path/to/pihole/backup/ /path/to/backup/storage/pihole/ | |
find /path/to/backup/storage/pihole/ -type f -name '*.tar.gz' -mtime +30 -delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
1] add a volume to the docker via run or compose.
-v /path/to/pihole/backup:/backup
2] inside that folder, add the
backup.sh
, besure tochmod +x
.3]now whenever you run:
docker exec pihole-container-name /backup/backup.sh
it will create a Pi-Hole teleport backup
.tar.gz
in/path/to/pihole/backup
that you can then backup however you like.i use a daily cron that runs the
pihole.sh