Date: Mon, 20 Sep 2010 23:32:25 -0400 From: "Matt Emmerton" <matt@gsicomp.on.ca> To: "Ryan Coleman" <editor@d3photography.com>, "FreeBSD Questions" <freebsd-questions@freebsd.org> Subject: Re: Zip file making issues Message-ID: <F7E03E13906D419C8417713D17CF49C9@hermes> References: <A166139D-842F-4ACA-B8B3-687A8C6ECE01@d3photography.com>
next in thread | previous in thread | raw e-mail | index | archive | help
----- Original Message ----- From: "Ryan Coleman" <editor@d3photography.com> To: "FreeBSD Questions" <freebsd-questions@freebsd.org> Sent: Monday, September 20, 2010 11:11 PM Subject: Zip file making issues Does anyone have any advice for this? I'm working on a series of commands - executed in a shell script - that zips a deep directory in a tree. But it makes the full path as part of the ZIP file. That's not what I want - I just want those directories that appear after the "*". In this case: "-J" eliminates all the paths - bad because it also kills those after the "*" Here's my default that includes the whole d*mn path. /usr/local/bin/zip -r /usr/www/d3photography.com/htdocs/images/paidphotos/1284343047-Le-ach.zip /mount/archive/orders/Sep20/1284343047-Le-ach/download* I could just run a "cd" to the directory parent and do it there - that would solve the problem - but that's simply too dangerous if the script generator throws an error on the next set of commands (a risk I do not want to take). So how do I get it to store as "download/small/image.jpg" inside of the ZIP file instead of "mount/archive/orders/Sep20/1284343047-Le-ach/download/small/image.jpg". I only recently discovered this bug -- none of my clients have had the guts to tell me about it. ============== Just change the directory before you start zipping. cd /mount/archive/orders/Sep20/1284343047-Le-ach /usr/local/bin/zip -r /usr/www/d3photography.com/htdocs/images/paidphotos/1284343047-Le-ch.zip download* -- Matt Emmerton
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F7E03E13906D419C8417713D17CF49C9>