Commit cb6f4840 authored by ale's avatar ale

Fix the restic restore command

parent f2bdef57
......@@ -174,14 +174,16 @@ func (r *resticRepository) Restore(ctx context.Context, backup Backup, ds Datase
return err
}
cmd := fmt.Sprintf(
"%s restore %s",
"%s restore",
r.resticCmd(),
snap,
)
for _, atom := range ds.Atoms {
cmd += fmt.Sprintf(" --include %s", filepath.Join(atom.SourcePath))
if atom.SourcePath != "" {
cmd += fmt.Sprintf(" --include %s", filepath.Join(atom.SourcePath))
}
}
cmd += fmt.Sprintf(" --target %s", target)
cmd += fmt.Sprintf(" %s", snap)
return r.shell.Run(ctx, cmd)
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment