From 127f0fc64c3be40e04918568a082fcf7fa1283ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Pl=C3=A1nsk=C3=BD?= Date: Mon, 26 Oct 2020 21:44:01 +0100 Subject: [PATCH] operations: move and copy log name of the destination object in verbose If the object is moved or copied rclone in verbose mode prints name of the destination object into the info log. --- fs/operations/operations.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/fs/operations/operations.go b/fs/operations/operations.go index d57153b33..68fbb6165 100644 --- a/fs/operations/operations.go +++ b/fs/operations/operations.go @@ -501,8 +501,11 @@ func Copy(ctx context.Context, f fs.Fs, dst fs.Object, remote string, src fs.Obj return newDst, err } } - - fs.Infof(src, actionTaken) + if src.String() != newDst.String() { + fs.Infof(src, "%s to: %s", actionTaken, newDst.String()) + } else { + fs.Infof(src, actionTaken) + } return newDst, err } @@ -556,7 +559,12 @@ func Move(ctx context.Context, fdst fs.Fs, dst fs.Object, remote string, src fs. newDst, err = doMove(ctx, src, remote) switch err { case nil: - fs.Infof(src, "Moved (server-side)") + if src.String() != newDst.String() { + fs.Infof(src, "Moved (server-side) to: %s", newDst.String()) + } else { + fs.Infof(src, "Moved (server-side)") + } + return newDst, nil case fs.ErrorCantMove: fs.Debugf(src, "Can't move, switching to copy")