|
|
@ -161,16 +161,16 @@ func (l Location) Backup(cron bool) error {
|
|
|
|
switch t {
|
|
|
|
switch t {
|
|
|
|
case TypeLocal:
|
|
|
|
case TypeLocal:
|
|
|
|
out, err = ExecuteResticCommand(backupOptions, cmd...)
|
|
|
|
out, err = ExecuteResticCommand(backupOptions, cmd...)
|
|
|
|
if VERBOSE {
|
|
|
|
|
|
|
|
colors.Faint.Println(out)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
case TypeVolume:
|
|
|
|
case TypeVolume:
|
|
|
|
err = backend.ExecDocker(l, cmd)
|
|
|
|
out, err = backend.ExecDocker(l, cmd)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
colors.Error.Println(out)
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if VERBOSE {
|
|
|
|
|
|
|
|
colors.Faint.Println(out)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// After hooks
|
|
|
|
// After hooks
|
|
|
@ -271,7 +271,7 @@ func (l Location) Restore(to, from string, force bool) error {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
err = backend.Exec([]string{"restore", "--target", to, "--path", path, "latest"})
|
|
|
|
err = backend.Exec([]string{"restore", "--target", to, "--path", path, "latest"})
|
|
|
|
case TypeVolume:
|
|
|
|
case TypeVolume:
|
|
|
|
err = backend.ExecDocker(l, []string{"restore", "--target", ".", "--path", path, "latest"})
|
|
|
|
_, err = backend.ExecDocker(l, []string{"restore", "--target", ".", "--path", path, "latest"})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|