Rclone --exclude error?

Hi, my command looks like this

rclone copy /mnt/user/Archive/Backups/d crypt-onedrive:Archive/Backups/d -v --log-file /mnt/user/Archive/Backups/test.log --exclude /mnt/user/Archive/Backups/d/Pasta\ Teste --exclude /mnt/user/Archive/Backups/d/Pasta\ Testa

Log file:

2021/03/23 12:08:06 INFO  : Horn-short.mp3: Copied (new)
2021/03/23 12:08:06 INFO  : Horn.mp3: Copied (new)
2021/03/23 12:08:06 INFO  : Ficha_XP_PF_v21_XP-4Ws.pdf: Copied (new)
2021/03/23 12:08:07 INFO  : Pasta Teste/PEER.txt: Copied (new)
2021/03/23 12:08:08 INFO  : a/red anuncios.txt: Copied (new)
2021/03/23 12:08:08 INFO  : 
Transferred:   	    1.299M / 1.299 MBytes, 100%, 347.507 kBytes/s, ETA 0s
Transferred:            5 / 5, 100%
Elapsed time:         9.6s

Source folder and backup folder after running the script:

So apparently my --exclude command is being ignored & folders with no files e.g., "b" and "Pasta Testa" are not being copied regardless... should this be normal? :pensive:

thanks for your help and time

Hi, welcome! :slight_smile:

Add --create-empty-src-dirs to create empty source dirs on destination, if that's what you want.

And make exclude filter relative to source path.

1 Like

Hello and thank you!

It worked perfectly, thank you!
I may have missed these pointers in the documentation

updated command

rclone copy /mnt/user/Archive/Backups/d crypt-onedrive:Archive/Backups/d -v --log-file /mnt/user/Archive/Backups/test.log --exclude /Pasta\ Teste/** --create-empty-src-dirs

1 Like

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