fix zfs send for expired snapshots
This commit is contained in:
parent
3b1d0fc850
commit
2ca0695a1f
19
box.go
19
box.go
@ -198,13 +198,18 @@ func TransferDirectZfs(from, to Addr) error {
|
||||
|
||||
}
|
||||
|
||||
fromFromSnapshotId := -1
|
||||
lastToSnapshot := toSnapshots[len(toSnapshots)-1]
|
||||
log.WithFields(log.Fields{"from": from, "to": to}).Debugf("searching last snapshot %s", lastToSnapshot.String())
|
||||
for id, v := range fromSnapshots {
|
||||
if v.name == lastToSnapshot.name {
|
||||
fromFromSnapshotId = id
|
||||
log.WithFields(log.Fields{"from": from, "to": to}).Debugf("found %s", v.String())
|
||||
fromFromSnapshotId := len(fromSnapshots)
|
||||
fromToSnapshotId := -1
|
||||
for fromFromSnapshotId >= 0 {
|
||||
fromFromSnapshotId = fromFromSnapshotId - 1
|
||||
fromToSnapshotId = len(toSnapshots)
|
||||
for fromToSnapshotId >= 0 {
|
||||
fromToSnapshotId = fromToSnapshotId - 1
|
||||
if fromSnapshots[fromFromSnapshotId].name == toSnapshots[fromToSnapshotId].name {
|
||||
break
|
||||
}
|
||||
}
|
||||
if fromToSnapshotId >= 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Code generated by version.sh (@generated) DO NOT EDIT.
|
||||
package main
|
||||
var githash = "e7ed6cb"
|
||||
var githash = "3b1d0fc"
|
||||
var branch = "master"
|
||||
var buildstamp = "2023-08-22_11:08:53"
|
||||
var commits = "85"
|
||||
var version = "e7ed6cb-b85 - 2023-08-22_11:08:53"
|
||||
var buildstamp = "2023-09-10_16:35:29"
|
||||
var commits = "86"
|
||||
var version = "3b1d0fc-b86 - 2023-09-10_16:35:29"
|
||||
|
3
zfs.go
3
zfs.go
@ -311,6 +311,9 @@ func (fs *ZfsFs) AddSnapshot(s *ZfsSnapshot) error {
|
||||
}
|
||||
|
||||
func (fs *ZfsFs) ValidSnapshots() []*ZfsSnapshot {
|
||||
log.WithFields(log.Fields{"box": fs.zfs.box.name, "fs": fs.path}).Debugf("starting")
|
||||
defer log.WithFields(log.Fields{"box": fs.zfs.box.name, "fs": fs.path}).Debugf("done")
|
||||
|
||||
tab := make([]*ZfsSnapshot, 0)
|
||||
|
||||
for _, s := range fs.snapshots {
|
||||
|
Loading…
Reference in New Issue
Block a user