Using sync and filtering

Hello,

What is the problem you are having with rclone?

Basically, I am wanting to run rclone sync across a directory that includes subdirectories and recurse through to the subdirectories. I have set up similar directory structure on destination that is on the source. I can do it one subdirectory at a time, but would prefer to not do this.

I know I have to use filtering, but I am not doing something right there. As I understand, if I run --include '/**', the command should recurse, but this does not happen.

rclone sync does recurse by default as you can see in this small example:

> rclone lsl ./testfolder
        0 2022-09-25 20:47:10.236241800 folder3/file3D.txt
        0 2022-09-25 20:45:59.468745300 folder1/file1A.txt
        0 2022-09-25 20:46:16.430763300 folder1/file1B.txt
        0 2022-09-25 20:46:44.032042300 folder2/file2C.txt
> rclone sync -v --dry-run ./testfolder ./testfolder2
2022/09/26 08:38:30 NOTICE: folder3/file3D.txt: Skipped copy as --dry-run is set (size 0)
2022/09/26 08:38:30 NOTICE: folder1/file1A.txt: Skipped copy as --dry-run is set (size 0)
2022/09/26 08:38:30 NOTICE: folder1/file1B.txt: Skipped copy as --dry-run is set (size 0)
2022/09/26 08:38:30 NOTICE: folder2/file2C.txt: Skipped copy as --dry-run is set (size 0)
2022/09/26 08:38:30 NOTICE: 
Transferred:              0 B / 0 B, -, 0 B/s, ETA -
Transferred:            4 / 4, 100%
Elapsed time:         0.0s

rclone will also automatically create the subfolders if needed. Use --create-empty-src-dirs if you also want it to create the empty subfolders (assuming you are not using a bucket based remote such as S3).

This isn't needed for a simple sync like the example above, so your --include '/**' doesn't hurt nor change anything.

If the above doesn't help then we need some additional info to help you, that is:

  • the output from rclone version
  • the redacted output from rclone config show yourRemote:
  • the command you are trying, e.g. rclone sync -v ./some/local/folder yourRemote:some/folder ...
  • the top structure of your data, e.g.rclone lsd ./some/local/folder and rclone lsd yourRemote:some/folder
1 Like

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