From owner-freebsd-questions@FreeBSD.ORG Tue Sep 21 03:54:03 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 589AE106564A for ; Tue, 21 Sep 2010 03:54:03 +0000 (UTC) (envelope-from editor@d3photography.com) Received: from qmta01.westchester.pa.hmc1.comcast.net (qmta01.westchester.pa.hmc1.comcast.net [76.96.53.8]) by mx1.freebsd.org (Postfix) with ESMTP id 16A6A8FC15 for ; Tue, 21 Sep 2010 03:54:02 +0000 (UTC) Received: from omta01.westchester.pa.hmc1.comcast.net ([76.96.53.6]) by qmta01.westchester.pa.hmc1.comcast.net with comcast id 9Fqs1f01G082Dic01Fu2oB; Tue, 21 Sep 2010 03:54:02 +0000 Received: from [10.0.1.9] ([70.89.202.1]) by omta01.westchester.pa.hmc1.comcast.net with bizsmtp id 9Ftz1f00102K3z201Fu1pe; Tue, 21 Sep 2010 03:54:02 +0000 Mime-Version: 1.0 (Apple Message framework v1081) From: Ryan Coleman X-Priority: 3 In-Reply-To: Date: Mon, 20 Sep 2010 22:53:58 -0500 Message-Id: <70BA7AC2-7300-41F6-9D3E-7AFEAD7F533E@d3photography.com> References: To: Matt Emmerton X-Mailer: Apple Mail (2.1081) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: FreeBSD Questions Subject: Re: Zip file making issues X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2010 03:54:03 -0000 On Sep 20, 2010, at 10:32 PM, Matt Emmerton wrote: >=20 > ----- Original Message ----- From: "Ryan Coleman" = > To: "FreeBSD Questions" > Sent: Monday, September 20, 2010 11:11 PM > Subject: Zip file making issues >=20 >=20 > Does anyone have any advice for this? >=20 > 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: >=20 > "-J" eliminates all the paths - bad because it also kills those after = the "*" >=20 > 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* >=20 > 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). >=20 > 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". >=20 > I only recently discovered this bug -- none of my clients have had the = guts to tell me about it. >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > Just change the directory before you start zipping. >=20 > 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* As I said in my OP: 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). Thank you, though. I'm hoping to find a solution instead with PHP. One = of these generated files comes out of PHP in a different directory path = where a change of directory is not possible. -- Ryan=