Danijel
Danijel

Reputation: 8610

Using rsync: how to exclude all directories which contain a specific word, case insensitive?

How do I exclude from rsync all directories which contain word "cache", case insensitive?

Upvotes: -3

Views: 44

Answers (1)

Iyus Dedi Putra
Iyus Dedi Putra

Reputation: 316

rsync doesn’t have a builtin case insensitive exclude option, so you have to create regex pattern that explicitly matches upper and lower case letters of the string.

For your cacse, you can use this command

rsync -avzh --exclude '*/[cC][aA][cC][hH][eE]*/*' source/ destination/

Or refer to this article Make rsync case insensitive to using other option to achieve it.

Upvotes: 1

Related Questions