mirror of
https://github.com/vmstan/gravity-sync.git
synced 2025-07-09 02:34:06 -04:00
Created Other Functions (markdown)
parent
e8da23538c
commit
deffb97f46
35
Other-Functions.md
Normal file
35
Other-Functions.md
Normal file
@ -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.
|
Loading…
x
Reference in New Issue
Block a user