Date: Mon, 20 Sep 2010 22:53:58 -0500 From: Ryan Coleman <editor@d3photography.com> To: Matt Emmerton <matt@gsicomp.on.ca> Cc: FreeBSD Questions <freebsd-questions@freebsd.org> Subject: Re: Zip file making issues Message-ID: <70BA7AC2-7300-41F6-9D3E-7AFEAD7F533E@d3photography.com> In-Reply-To: <F7E03E13906D419C8417713D17CF49C9@hermes> References: <A166139D-842F-4ACA-B8B3-687A8C6ECE01@d3photography.com> <F7E03E13906D419C8417713D17CF49C9@hermes>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sep 20, 2010, at 10:32 PM, Matt Emmerton wrote: >=20 > ----- 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 >=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=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?70BA7AC2-7300-41F6-9D3E-7AFEAD7F533E>