forked from TrueCloudLab/restic
parent
a9c2e84ccd
commit
09bd924710
1 changed files with 13 additions and 2 deletions
|
@ -76,6 +76,11 @@ func (res *Restorer) restoreTo(ctx context.Context, target, location string, tre
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sockets cannot be restored
|
||||||
|
if node.Type == "socket" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
selectedForRestore, childMayBeSelected := res.SelectFilter(nodeLocation, nodeTarget, node)
|
selectedForRestore, childMayBeSelected := res.SelectFilter(nodeLocation, nodeTarget, node)
|
||||||
debug.Log("SelectFilter returned %v %v", selectedForRestore, childMayBeSelected)
|
debug.Log("SelectFilter returned %v %v", selectedForRestore, childMayBeSelected)
|
||||||
|
|
||||||
|
@ -96,14 +101,20 @@ func (res *Restorer) restoreTo(ctx context.Context, target, location string, tre
|
||||||
if selectedForRestore {
|
if selectedForRestore {
|
||||||
err = res.restoreNodeTo(ctx, node, nodeTarget, nodeLocation, idx)
|
err = res.restoreNodeTo(ctx, node, nodeTarget, nodeLocation, idx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
err = res.Error(nodeLocation, node, errors.Wrap(err, "restoreNodeTo"))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore directory timestamp at the end. If we would do it earlier, restoring files within
|
// Restore directory timestamp at the end. If we would do it earlier, restoring files within
|
||||||
// the directory would overwrite the timestamp of the directory they are in.
|
// the directory would overwrite the timestamp of the directory they are in.
|
||||||
err = node.RestoreTimestamps(nodeTarget)
|
err = node.RestoreTimestamps(nodeTarget)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
err = res.Error(nodeLocation, node, errors.Wrap(err, "RestoreTimestamps"))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue