diff --git a/internal/backend/local/local.go b/internal/backend/local/local.go index 19f083a29..675c4a08d 100644 --- a/internal/backend/local/local.go +++ b/internal/backend/local/local.go @@ -130,7 +130,14 @@ func (b *Local) Save(ctx context.Context, h restic.Handle, rd restic.RewindReade return errors.Wrap(err, "Close") } - return setNewFileMode(filename, backend.Modes.File) + // ignore if the operation fails as some filesystems don't allow the chmod call + // e.g. exfat and network file systems with certain mount options + err = setNewFileMode(filename, backend.Modes.File) + if err != nil && !os.IsPermission(err) { + return errors.Wrap(err, "Chmod") + } + + return nil } // Load runs fn with a reader that yields the contents of the file at h at the @@ -205,7 +212,7 @@ func (b *Local) Remove(ctx context.Context, h restic.Handle) error { // reset read-only flag err := fs.Chmod(fn, 0666) - if err != nil { + if err != nil && !os.IsPermission(err) { return errors.Wrap(err, "Chmod") }