mirror of
https://github.com/restic/restic.git
synced 2026-10-19 15:58:12 +00:00
Merge pull request #3854 from MichaelEischer/sparsefiles
restore: Add support for sparse files
This commit is contained in:
16 files changed
+393
-88
No files matched your search
@@ -42,6 +42,7 @@ type RestoreOptions struct {
|
||||
InsensitiveInclude []string
|
||||
Target string
|
||||
snapshotFilterOptions
|
||||
Sparse bool
|
||||
Verify bool
|
||||
}
|
||||
|
||||
@@ -58,6 +59,7 @@ func init() {
|
||||
flags.StringVarP(&restoreOptions.Target, "target", "t", "", "directory to extract data to")
|
||||
|
||||
initSingleSnapshotFilterOptions(flags, &restoreOptions.snapshotFilterOptions)
|
||||
flags.BoolVar(&restoreOptions.Sparse, "sparse", false, "restore files as sparse")
|
||||
flags.BoolVar(&restoreOptions.Verify, "verify", false, "verify restored files content")
|
||||
}
|
||||
|
||||
@@ -147,7 +149,7 @@ func runRestore(opts RestoreOptions, gopts GlobalOptions, args []string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
res, err := restorer.NewRestorer(ctx, repo, id)
|
||||
res, err := restorer.NewRestorer(ctx, repo, id, opts.Sparse)
|
||||
if err != nil {
|
||||
Exitf(2, "creating restorer failed: %v\n", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user