From deffb97f46f797c908625b3052b61e51dee3262c Mon Sep 17 00:00:00 2001 From: Michael Stanclift Date: Wed, 21 Oct 2020 13:18:51 -0500 Subject: [PATCH] Created Other Functions (markdown) --- Other-Functions.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Other-Functions.md diff --git a/Other-Functions.md b/Other-Functions.md new file mode 100644 index 0000000..3237e3e --- /dev/null +++ b/Other-Functions.md @@ -0,0 +1,35 @@ +### The Pull Function + +The Gravity Sync Pull, prior to version 2.0, was the standard method of sync operation, and will not prompt for user input after execution. + +```bash +./gravity-sync.sh pull +``` + +If the execution completes, you will now have overwritten your running `gravity.db` and `custom.list` on the secondary Pi-hole after creating a copy of the running files (with `.backup` appended) in the `backup` subfolder located with your script. Gravity Sync will also keep a copy of the last sync'd files from the primary (in the `backup` folder appended with `.pull`) for future use. + +### The Push Function + +Gravity Sync includes the ability to `push` from the secondary Pi-hole back to the primary. This would be useful in a situation where your primary Pi-hole is down for an extended period of time, and you have made list changes on the secondary Pi-hole that you want to force back to the primary, when it comes online. + +```bash +./gravity-sync.sh push +``` + +Before executing, this will make a copy of the remote database under `backup/gravity.db.push` and `backup/custom.list.push` then sync the local configuration to the primary Pi-hole. + +This function purposefully asks for user interaction to avoid being accidentally automated. + +- If your script prompts for a password on the remote system, make sure that your remote user account is setup not to require passwords in the sudoers file. + +### The Restore Function + +Gravity Sync can also `restore` the database on the secondary Pi-hole in the event you've overwritten it accidentally. This might happen in the above scenario where you've had your primary Pi-hole down for an extended period, made changes to the secondary, but perhaps didn't get a chance to perform a `push` of the changes back to the primary, before your automated sync ran. + +```bash +./gravity-sync.sh restore +``` + +This will copy your last `gravity.db.backup` and `custom.list.backup` to the running copy on the secondary Pi-hole. + +This function purposefully asks for user interaction to avoid being accidentally automated. \ No newline at end of file