diff --git a/backend/cache/cache.go b/backend/cache/cache.go index 8b1263cad..98ebe79b0 100644 --- a/backend/cache/cache.go +++ b/backend/cache/cache.go @@ -520,9 +520,6 @@ func NewFs(name, rootPath string, m configmap.Mapper) (fs.Fs, error) { // override only those features that use a temp fs and it doesn't support them //f.features.ChangeNotify = f.ChangeNotify if f.opt.TempWritePath != "" { - if f.tempFs.Features().Copy == nil { - f.features.Copy = nil - } if f.tempFs.Features().Move == nil { f.features.Move = nil } @@ -1533,6 +1530,9 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, fs.Errorf(src, "source remote (%v) doesn't support Copy", src.Fs()) return nil, fs.ErrorCantCopy } + if f.opt.TempWritePath != "" && src.Fs() == f.tempFs { + return nil, fs.ErrorCantCopy + } // the source must be a cached object or we abort srcObj, ok := src.(*Object) if !ok { diff --git a/cmd/backend/backend.go b/cmd/backend/backend.go index 2d32ff447..12c5a3f33 100644 --- a/cmd/backend/backend.go +++ b/cmd/backend/backend.go @@ -59,7 +59,7 @@ Note to run these commands on a running backend then see [backend/command](/rc/#backend/command) in the rc docs. `, RunE: func(command *cobra.Command, args []string) error { - cmd.CheckArgs(2, 1E6, command, args) + cmd.CheckArgs(2, 1e6, command, args) name, remote := args[0], args[1] cmd.Run(false, false, command, func() error { // show help if remote is a backend name