Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3de3e2b688 | |||
| 3edfe535c6 | |||
| d3b99e8e39 | |||
| 3c03f21419 |
@@ -26,6 +26,7 @@ jobs:
|
||||
- type: last_n
|
||||
count: 10
|
||||
keep_receiver:
|
||||
- type: most_recent_common_snapshot
|
||||
- type: grid
|
||||
grid: 1x1h(keep=all) | 24x1h | 35x1d | 6x30d
|
||||
regex: "zrepl_.*"
|
||||
+2
-1
@@ -56,7 +56,8 @@ We use the following annotations for classifying changes:
|
||||
| zrepl is a spare-time project primarily developed by `Christian Schwarz <https://cschwarz.com>`_.
|
||||
| You can support maintenance and feature development through one of the following services:
|
||||
| |Donate via Patreon| |Donate via Liberapay| |Donate via PayPal|
|
||||
| For commerical support, please `contact Christian directly <https://cschwarz.com>`_.
|
||||
| Note that PayPal processing fees are relatively high for small donations.
|
||||
| For SEPA wire transfer and **commerical support**, please `contact Christian directly <https://cschwarz.com>`_.
|
||||
|
||||
|
||||
0.1.1
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ Main Features
|
||||
* **Filesystem replication**
|
||||
|
||||
* [x] Pull & Push mode
|
||||
* [x] Multiple transport :ref:`transports <transport>`: TCP, TCP + TLS client auth, SSH
|
||||
* [x] Multiple :ref:`transport modes <transport>`: TCP, TCP + TLS client auth, SSH
|
||||
|
||||
* Advanced replication features
|
||||
|
||||
|
||||
+2
-2
@@ -55,8 +55,8 @@ set -e
|
||||
sphinx-versioning build \
|
||||
--show-banner \
|
||||
--whitelist-branches '^master$' \
|
||||
--whitelist-tags '(v)?\d+\.\d+\.\d+$' \
|
||||
--whitelist-tags '(v)?0.1.0-rc(3|4)$' \
|
||||
--whitelist-tags '(v)?\d+\.[1-9][0-9]*.\d+$' \
|
||||
--whitelist-tags '(v)?0.2.0-rc.*$' \
|
||||
docs ./public_git \
|
||||
-- -c sphinxconf # older conf.py throw errors because they used
|
||||
# version = subprocess.show_output(["git", "describe"])
|
||||
|
||||
+2
-1
@@ -6,7 +6,7 @@
|
||||
|
||||
zrepl is a spare-time project primarily developed by `Christian Schwarz <https://cschwarz.com>`_.
|
||||
You can support maintenance and feature development through one of the services listed above.
|
||||
For commerical support, please `contact Christian directly <https://cschwarz.com>`_.
|
||||
For SEPA wire transfer and **commerical support**, please `contact Christian directly <https://cschwarz.com>`_.
|
||||
|
||||
**Thanks for your support!**
|
||||
|
||||
@@ -20,6 +20,7 @@ Supporters
|
||||
|
||||
We would like to thank the following people / organizations for supporting zrepl through monetary and other means:
|
||||
|
||||
* `Marshall Clyburn <https://github.com/mdclyburn>`_
|
||||
* `Ross Williams <https://github.com/overhacked>`_
|
||||
* Mike T.
|
||||
* `Justin Scholz <https://github.com/JMoVS>`_
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ We define a **push job** named ``prod_to_backups`` in ``/etc/zrepl/zrepl.yml`` o
|
||||
key: /etc/zrepl/prod.key
|
||||
server_cn: "backups"
|
||||
filesystems: {
|
||||
"zroot/var/db:": true,
|
||||
"zroot/var/db": true,
|
||||
"zroot/usr/home<": true,
|
||||
"zroot/usr/home/paranoid": false
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package pruning
|
||||
|
||||
import "sort"
|
||||
|
||||
type KeepMostRecentCommonAncestor struct {
|
||||
_opaque struct{}
|
||||
}
|
||||
|
||||
func NewKeepMostRecentCommonAncestor() *KeepMostRecentCommonAncestor {
|
||||
return &KeepMostRecentCommonAncestor{}
|
||||
}
|
||||
|
||||
func (k *KeepMostRecentCommonAncestor) KeepRule(snaps []Snapshot) (destroyList []Snapshot) {
|
||||
var bothSides []Snapshot
|
||||
for _, s := range snaps {
|
||||
if s.PresentOnBothSides() {
|
||||
bothSides = append(bothSides, s)
|
||||
}
|
||||
}
|
||||
if len(bothSides) == 0 {
|
||||
return []Snapshot{}
|
||||
}
|
||||
|
||||
sort.Slice(bothSides, func(i, j int) bool {
|
||||
return bothSides[i].Date().After(bothSides[j].Date())
|
||||
})
|
||||
|
||||
return []Snapshot{bothSides[0]}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package pruning
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestKeppMostRecentCommonAncestor(t *testing.T) {
|
||||
|
||||
o := func(minutes int) time.Time {
|
||||
return time.Unix(123, 0).Add(time.Duration(minutes) * time.Minute)
|
||||
}
|
||||
|
||||
tcs := map[string]testCase{
|
||||
"empty": {
|
||||
inputs: []Snapshot{},
|
||||
rules: []KeepRule{NewKeepMostRecentCommonAncestor()},
|
||||
expDestroy: map[string]bool{},
|
||||
},
|
||||
"nil": {
|
||||
inputs: nil,
|
||||
rules: []KeepRule{NewKeepMostRecentCommonAncestor()},
|
||||
expDestroy: map[string]bool{},
|
||||
},
|
||||
"": {
|
||||
inputs: []Snapshot{
|
||||
stubSnap{name: "s1", date: o(5), bothSides: }
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
testTable(tcs, t)
|
||||
|
||||
}
|
||||
@@ -17,6 +17,7 @@ type Snapshot interface {
|
||||
Name() string
|
||||
Replicated() bool
|
||||
Date() time.Time
|
||||
PresentOnBothSides() bool
|
||||
}
|
||||
|
||||
// The returned snapshot list is guaranteed to only contains elements of input parameter snaps
|
||||
|
||||
@@ -9,6 +9,7 @@ type stubSnap struct {
|
||||
name string
|
||||
replicated bool
|
||||
date time.Time
|
||||
bothSides bool
|
||||
}
|
||||
|
||||
func (s stubSnap) Name() string { return s.name }
|
||||
|
||||
Reference in New Issue
Block a user