Sync, but copy changed files to an alternative location rather than to the remote?

Suppose I have two directories that each contain similar datasets, but with some differences.

What I'd love to be able to do is to setup a job that looks at remote A, compares it with remote B, and then copies any files that differ on remote B into a separate remote C.

Naturally this can't account for deleted files, but it can account for new or changed files.

Here's a quick example:

Remote A:

    remote_a/
    remote_a/myfile.txt
    remote_a/anotherfile.txt
    remote_a/newfile.txt

Remote B:

    remote_b/
    remote_b/myfile.txt
    remote_b/anotherfile.txt (differs from same file on remote A)

What I want to end up on remote C:

    remote_c/
    remote_c/anotherfile.txt (copy from remote A, since it differs from what is on remote B)
    remote_c/newfile.txt

Another way to put it: if I were to tar up the contents of remote C and extract them over remote B, the result would be the same as a sync, except for that files won't be deleted.

For deleted files perhaps a list of the files could be included as well.

Maybe this can already be done with some magic? (can rclone list changed files without syncing them, which could then be fed into a separate copy process?) Otherwise, some sort of makediff command or switch to the sync command could maybe accomplish it. For example:

    rclone sync --make-diff-in myremote:directory_differences/ --deleted-file-list-to deleted.files.txt /local/file/path myremote:/remote/file/path

A use case for this might be if you're using the http remote to sync a public index web server, but you want to be able to make "patches" or "update packages" that contain only the files that have changed on the web server.

Thoughts?

Depending on exactly where the remotes are --compare-dest might be what you want. What do you think?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.