4

I'm using rclone to copy a shared Google Drive folder, but I'm running into a problem: when copying the same folder to the same location over and over again, rclone creates new folders each time, each a duplicate to an existing folder in the folder. I believe this is due to the fact that rclone only considers two files identical if they match name, hash and mod-time, rather than just name. So, is there a flag I can pass to rclone so it will skip based only on identical file names? I tried --ignore-existing but it didn't work.

An example: rclone copy remote:folder_to_copy_from remote: --drive-folder-id=id_of_folder_to_copy_to copies folder_to_copy_from/a.txt to folder_to_copy_to, even if folder_to_copy_to/a.txt exists.

2 Answers 2

9

Apparently all you needed was --ignore-existing at the end.

4
  • 1
    Strange that you said you already tried it and it didn't work but now it does. If you figure out what changed, let us know.
    – NetServOps
    Jun 21, 2021 at 3:35
  • @NetServOps Maybe it's because I removed the --drive-shared-with-me?
    – StarDust
    Jun 21, 2021 at 15:35
  • rclone check remote:folder_to_copy_from remote:folder_to_copy_to --size-only --one-way --missing-on-dst A.txt confirmed this.
    – StarDust
    Jun 21, 2021 at 15:50
  • confirmed what? you latest comment showed that you didn't include --ignore-existing however you answer said you move it to the end the command; are you saying you replaced ignore-existing with --missing-on-dst?
    – stucash
    Dec 20, 2022 at 7:15
1

If you have many files in /path/to/src but only a few of them change every day, you can copy all the files which have changed recently very efficiently like this:

rclone copy --max-age 24h --no-traverse /path/to/src remote:

Note: Use the -P/--progress flag to view real-time transfer statistics.

Note: Use the --dry-run or the --interactive/-i flag to test without copying anything.

rclone copy source:path dest:path [flags]

Source - https://rclone.org/commands/rclone_copy/

Note that it is always the contents of the directory that is synced, not the directory so when source:path is a directory, it's the contents of source:path that are copied, not the directory name and contents.

If dest:path doesn't exist, it is created and the source:path contents go there.

1
  • Comments are not for extended discussion; this conversation has been moved to chat.
    – DavidPostill
    Jun 21, 2021 at 7:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .