How to exclude directory that contains a specific file name?

I'd like to copy all directories except ones that contain a file like '.rclone-ignore' or something so that I can specifically filter out certain folders that I don't want copied yet. I don't know if I need to back up certain data directories right now but I might want to back them up at a later date, in which case I would delete the .rclone-ignore file in those directories.

I'm guessing this can be done with some sort of filter, but I was looking through the documentation and nothing stuck out as the solution to my problem. Can someone point me in the right direction?


Welcome to the forum!

Could --exclude-if-present be a solution for you?

rclone sync --exclude-if-present .rclone-ignore dir1 remote:backup

Yep, that looks like what I want. Thanks!

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