121
37
I'm trying to zip a directory (on Unix via SSH) but I need to exclude a couple of subdirectories (and all files and directories within them).
So far I have this:
zip -r myarchive.zip dir1 -x dir1/ignoreDir/**/*
That doesn't seem to work though.
I also tried
zip -r myarchive.zip dir1 -x dir1/ignoreDir1/* dir1/ignoreDir2/*
However that will still include subdirectories within ignoreDir1 and ignoreDir2.
The subdirectory structure in the directories that I want to exclude is quite substantial so I can't simply add each directory to the -x argument.
Does anyone know how to do this?
@AlexanderMills - See this question. – jww – 2018-01-01T01:02:51.080