If you're new to the terminal, then it's likely you haven't learned the daunting but helpful world of man pages :D
If you do man zip
at the command line the intended usage of zip is the following:
"Normally when an input pattern
does not match a file the "name not matched" warning is issued
"
If zip is not able to read a file, it issues a warning but continues.
See the -MM option below for more on how zip handles patterns that are
not matched and files that are not readable. If some files were
skipped, a warning is issued at the end of the zip operation noting how
many files were read and how many skipped."
I would start by replacing your zip command with a an echo "${i%/}" and see what your output is. Somewhere a folder is causing an issue, either you are unable to access it or it's name is incorrect. Since you're just looking at folders in one directory you can use find . -type d -readable
to compare against the directories you want to access to see if there is a folder that you do not actually have access to read.
related Unix Stack Exchange Answers:
https://stackoverflow.com/questions/20529851/zip-command-not-working
"zip warning: name not matched" while compressing a directory
zip -r
but actuallyzip M-bM-^@M-^Pr
that's why it doesn't work. – don_crissti Feb 20 '16 at 11:45