Skip to content

Commit

Permalink
Fix collection-status truncation (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptobioz authored and raphink committed Jun 26, 2017
1 parent a5b7e2c commit 312b1f3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions engines/duplicity.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,10 @@ func (d *DuplicityEngine) verify() (err error) {
// status gets the latest backup date info from duplicity
func (d *DuplicityEngine) status() (err error) {
var stdout string
collectionComplete := false
attempts := 3
v := d.Volume
for i := 1; i <= attempts; i++ {
for i := 0; i < attempts; i++ {
_, stdout, err = d.launchDuplicity(
[]string{
"collection-status",
Expand All @@ -205,13 +206,14 @@ func (d *DuplicityEngine) status() (err error) {
return
}
if strings.Contains(stdout, "No orphaned or incomplete backup sets found.") {
collectionComplete = true
break
} else {
log.Debug("No end string found, the collection-status output may be wrong, retrying ...")
log.Debug("No end string, found the collection-status output may be wrong, retrying ...")
}
}

if strings.Contains(stdout, "No orphaned or incomplete backup sets found.") {
if !collectionComplete {
err = fmt.Errorf("failed to retrieve full output from collection-status after %v attempts", attempts)
return
}
Expand Down

0 comments on commit 312b1f3

Please sign in to comment.