Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #47 from vmstan/development
Browse files Browse the repository at this point in the history
2.0.0
  • Loading branch information
vmstan authored Jul 7, 2020
2 parents 7e22b3a + 583c7c8 commit 80205ea
Show file tree
Hide file tree
Showing 6 changed files with 334 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ gravity-sync.log
gravity-sync.cron
gravity.db.last
gravity-sync.conf
gravity-sync.md5
backup/*.last
backup/*.backup
backup/*.push
Expand Down
13 changes: 9 additions & 4 deletions ADVANCED.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Download the latest release from [GitHub](https://github.com/vmstan/gravity-sync

```bash
cd ~
wget https://github.com/vmstan/gravity-sync/archive/v1.8.3.zip
unzip v1.8.3.zip -d gravity-sync
wget https://github.com/vmstan/gravity-sync/archive/v2.0.0.zip
unzip v2.0.0.zip -d gravity-sync
cd gravity-sync
```

Expand Down Expand Up @@ -97,7 +97,7 @@ Gravity Sync will place logs in the same folder as the script (identified as .cr
Default setting in Gravity Sync is `$HOME/${LOCAL_FOLDR}`

#### `SYNCING_LOG=''`
Gravity Sync will write a timestamp for any completed pull, push or restore job to this file. If you want to change the name of this file, you will also need to adjust the LOG_PATH variable above, otherwise your file will be remove during an `update` operations.
Gravity Sync will write a timestamp for any completed sync, pull, push or restore job to this file. If you want to change the name of this file, you will also need to adjust the LOG_PATH variable above, otherwise your file will be remove during an `update` operations.

Default setting in Gravity Sync is `gravity-sync.log`

Expand All @@ -108,6 +108,11 @@ This will have an impact to both the `./gravity-sync.sh automate` function and t

Default setting in Gravity Sync is `gravity-sync.cron`

#### `HISTORY_MD5=''`
Gravity Sync will log the file hashes of the previous `smart` task to this file. If you want to change the name of this file, you will also need to adjust the LOG_PATH variable above, otherwise your file will be removed during an `update` operations.

Default setting in Gravity Sync is `gravity-sync.md5`

#### `VERIFY_PASS=''`
Gravity Sync will prompt to verify user interactivity during push, restore, or config operations (that overwrite an existing configuration) with the intention that it prevents someone from accidentally automating in the wrong direction or overwriting data intentionally. If you'd like to automate a push function, or just don't like to be asked twice to do something distructive, then you can opt-out.

Expand Down Expand Up @@ -173,5 +178,5 @@ If you prefer to still use cron but modify your settings by hand, using the entr

```bash
crontab -e
*/30 * * * * /bin/bash /home/USER/gravity-sync/gravity-sync.sh pull > /home/USER/gravity-sync/gravity-sync.cron
*/30 * * * * /bin/bash /home/USER/gravity-sync/gravity-sync.sh > /home/USER/gravity-sync/gravity-sync.cron
```
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# The Changelog

## 2.0
### The Smart Release

**Features**
In this release, Gravity Sync will now detect not only if each component (`gravity.db` and `custom.list`) has changed since the last sync, but also what direction they need to go. It will then initate a `push` and/or `pull` specific to each piece.

Example: If the `gravity.db` has been modified on the primary Pi-hole, but the `custom.list` file has been changed on the secondary, Gravity Sync will now do a pull of the `gravity.db` then push `custom.list` and finally restart the correct components on each server. It will also now only perform a sync of each component if there are changes within each type to replicate. So if you only make a small change to your Local DNS settings, it doesn't kickoff the larger `gravity.db` replication.

The default command for Gravity Sync is now just `./gravity-sync.sh` -- but you can also run `./gravity-sync.sh smart` if you feel like it, and it'll do the same thing.

This allows you to be more flexible in where you make your configuration changes to block/allow lists and local DNS settings being made on either the primary or secondary, but it's best practice to continue making changes on one side where possible. In the event there are configuration changes to the same element (example, `custom.list` changes at both sides) then Gravity Sync will attempt to determine based on timestamps on what side the last changed happened, in which case the latest changes will be considered authoritative and overwrite the other side. Gravity Sync does not merge the contents of the files when changes happen, it simply overwrites the entire content.

New installs will use the `smart` function by default. Existing users who want to use this new method as their standard should run `./gravity-sync.sh automate` function to replace the existing automated `pull` with the new Smart Sync. This is not required. The previous `./gravity-sync.sh pull` and `./gravity-sync.sh push` commands continue to function as they did previously, with no intention to break this functionality.

## 1.8
### The Logical Release

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.8.3
2.0.0
1 change: 1 addition & 0 deletions gravity-sync.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ REMOTE_PASS=''
# LOG_PATH=''
# SYNCING_LOG=''
# CRONJOB_LOG=''
# HISTORY_MD5=''

# VERIFY_PASS=''
# SKIP_CUSTOM=''
Expand Down
Loading

0 comments on commit 80205ea

Please sign in to comment.