diff --git a/internal/archiver/archiver.go b/internal/archiver/archiver.go index 9f2e029fb..55024b53a 100644 --- a/internal/archiver/archiver.go +++ b/internal/archiver/archiver.go @@ -692,6 +692,13 @@ func (arch *Archiver) Snapshot(ctx context.Context, p *restic.Progress, paths, t } sn.Excludes = arch.Excludes + // make paths absolute + for i, path := range paths { + if p, err := filepath.Abs(path); err == nil { + paths[i] = p + } + } + jobs := archivePipe{} // use parent snapshot (if some was given) diff --git a/internal/restic/snapshot.go b/internal/restic/snapshot.go index 4622bb530..2eace5cfd 100644 --- a/internal/restic/snapshot.go +++ b/internal/restic/snapshot.go @@ -31,7 +31,7 @@ type Snapshot struct { // time. func NewSnapshot(paths []string, tags []string, hostname string, time time.Time) (*Snapshot, error) { for i, path := range paths { - if p, err := filepath.Abs(path); err != nil { + if p, err := filepath.Abs(path); err == nil { paths[i] = p } }