Allow syncing metadata only

Feature Description

When using rclone sync/rclone copy, allow user to sync/update metadata of the already-existing file in the destination without re-transfer the file., possibly with some command flags like: --update-metadata

source:/
a.txt  [metadata-1]
b.txt  [metadata-2]
c.txt  [metadata-3]

dest:/
a.txt  [metadata-10]
b.txt  [metadata-2]

Then after rclone sync it should become:

source:/
a.txt  [metadata-1]
b.txt  [metadata-2]
c.txt  [metadata-3]

dest:/
a.txt  [metadata-1]   // metadata synced, without file content re-transfer
b.txt  [metadata-2]   // do nothing
c.txt  [metadata-3]   // file content and metadata synced

Usecase

Some other syncing client (for example the current version of NextCloud desktop) seems to determine file changes using metadata like modtime only (even if the file content is identical), and this could cause unnecessary resync.

And rclone could be a workaround to these types of issues if it could help user sync metadata (like modtime) from source to destination so that some of other syncing client will not re-sync those files again.


I have found similar discussion related to this feature but it's been closed

1 Like

weclome to the forum,

a possible workaround is:

  1. get modtime from source file, using rclone lsf source:a.txt --format=t
  2. rclone touch dest:a.txt with modtime from step 1

Thanks for your reply!

I've checked the doc of rclone touch and it seems to be a workaround in some case.
However, it doesn't work when:

  • There are multiple directories and files in the source, each with different metadata.
  • We want to sync those metadata (including modtime info) from the source to the destination, without changing any source metadata.

"without changing any source metadata" If without this limit, there could be a workaround to touch files&directories both in source and remote to make them have the same modtime.