I want to rysnc my folder and subfolder tree structure without their files but with a max depth of 3 (/folder1/folder2/folder3) and exclude specific folders (ex. cache/)
I have tried this command:
$ rsync -azv --include=*/ --exclude=* --exclude=cache/ --exclude=/*/*/*/ source/ destination/
but it is not working... it is copying all folders and subfolders; it does not respect the max depth and it is not excluding cache folder
Do it need to use another parameter to restrict the max depth of the rsyc; what is wrong with my existing parameters?
p.s. last time I asked this question, it was tagged as duplicate of Rsync filter: copying one pattern only
It is not as it does not deal with max depth nor deal with rsync directory tree structure only. thx