View Full Version : UNIX zip
pdstein
05-25-2001, 02:28 PM
I'm trying to zip a bunch of directories into one file but exclude one directory in particular.[nbsp][nbsp]Unfortunately, it doesn't seem to be working.[nbsp][nbsp]I've tried
zip temp.zip -r www -x www/member
But I still end up with the member directory included.
Bruce
05-25-2001, 04:31 PM
It doesn't appear that UNIX zip has any way of doing what you want.[nbsp][nbsp]You can work around it by running the following rather horrific command:
find www \( -name member -prune \) -o -print0 | xargs -0 zip temp.zip
What this does is to find all files and directories in www except for member and its subdirectories, and pass them as command-line arguments (xargs) to zip.
If the person you are sending the zip file to has WinZip or something else that can handle tar files, you may want to try the following:
tar -czvf temp.tar.gz www --exclude=member
This has the added bonus of producing a smaller resulting file, sometimes much smaller if you're compressing many small files.
I hope this helps.
------------------
Bruce Guenter, FutureQuest
http://untroubled.org/
ryount
06-03-2001, 09:12 PM
Interesting.[nbsp][nbsp]I just tested it on one of my AIX boxes and it works with zip version 2.2.[nbsp][nbsp]FQ uses 2.3, wonder if that makes a difference?
vBulletin® v3.6.8, Copyright ©2000-2012, Jelsoft Enterprises Ltd.