this mask results in subdirectories being created on the local machine which are empty because they didn't contain any HTML files on the remoth machine. Is there any way to avoid this?
No :-(
A pity. Never mind.
If I understand it right, you ask for the same thing as in the first question, just using different words. Right? :-)
Well, the second question was a generalisation of the first. :-)
Maybe I'm missing something, but IMHO you can match anything below .../public_html using mask "*/public_html/*; */public_html/*/*". Shorter, but less precise form would be "*/public_html*/*".
Indeed you're right. I thought I had the * figured out, but now I see that * really can match "chunks" of pathnames, not just individual (parts of) foldernames or filenames. It was the information about the last slash in mask (except for the trailing slash that indicates directory mask) being the one which separates the path mask from the file mask that made it all make sense.
So something like the $ wildcard is only needed if there's no other way of solving the first issue. (Not that this issue has bothered me personally.)
Cheers then,
Anton