Compare and check 2 folders, move that files on a third folder

I would like to create a script that moves files from a remote 1directory to another remote 2directory, but only those files in the 1directory that are the same as those in a local 3directory.

Thus:

  • if the file in folder1 (remote) is equal to folder3 (local)
  • then move that file from folder1 to folder2

I would like to create a script that moves files from a remote 1directory to another remote 2directory, but only those files in the 1directory that are the same as those in a local 3directory.

Thus:

  • if the file in folder1 (remote) is equal to folder3 (local)
  • then move that file from folder1 to folder2

now I don't understand what function I should use, and how to set it up, to do this "check" on the remote and local folder.

There might be an easier way, but I think this should do what you want:

rclone check folder1 folder3 --match matches.txt
rclone move folder1 folder2 --files-from matches.txt

Be sure to --dry-run first to verify :slight_smile:

1 Like

Thank you very much!!! The solution is perfect!!!

1 Like

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