How to make Rsync with the --delete option to ignore a specific folder?

There is rsync with the --delete option. How to make it ignore a certain folder on the receiving side or remove it.
October 3rd 19 at 01:43
1 answer
October 3rd 19 at 01:45
Solution
--exclude=PATTERN

mkdir testrsync
cd testrsync/
mkdir src dst
cd src/
mkdir 1 2 3 4 5 
cd ../dst/
mkdir ex
cd ..
rsync-acz --delete --exclude=ex src/ dst/ 
ls dst/
1 2 3 4 5 ex
rsync-acz --delete src/ dst/ 
ls dst/
1 2 3 4 5
Thank you. Here I am a fool, for some reason I thought that --exclude excludes from the sending party. - alta73 commented on October 3rd 19 at 01:48
excludes from both sides - alice_Swaniawski commented on October 3rd 19 at 01:51

Find more questions by tags Linux