forked from TrueCloudLab/restic
backup: Parse timestamp earlier
This commit is contained in:
parent
419acad3c3
commit
42ebb0a0a6
1 changed files with 8 additions and 8 deletions
|
@ -336,6 +336,14 @@ func runBackup(opts BackupOptions, gopts GlobalOptions, term *termstatus.Termina
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
timeStamp := time.Now()
|
||||||
|
if opts.TimeStamp != "" {
|
||||||
|
timeStamp, err = time.Parse(TimeFormat, opts.TimeStamp)
|
||||||
|
if err != nil {
|
||||||
|
return errors.Fatalf("error in time option: %v\n", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var t tomb.Tomb
|
var t tomb.Tomb
|
||||||
|
|
||||||
p := ui.NewBackup(term, gopts.verbosity)
|
p := ui.NewBackup(term, gopts.verbosity)
|
||||||
|
@ -402,14 +410,6 @@ func runBackup(opts BackupOptions, gopts GlobalOptions, term *termstatus.Termina
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
timeStamp := time.Now()
|
|
||||||
if opts.TimeStamp != "" {
|
|
||||||
timeStamp, err = time.Parse(TimeFormat, opts.TimeStamp)
|
|
||||||
if err != nil {
|
|
||||||
return errors.Fatalf("error in time option: %v\n", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var targetFS fs.FS = fs.Local{}
|
var targetFS fs.FS = fs.Local{}
|
||||||
if opts.Stdin {
|
if opts.Stdin {
|
||||||
p.V("read data from stdin")
|
p.V("read data from stdin")
|
||||||
|
|
Loading…
Reference in a new issue