Re: simple zip via cron problem





robert wrote:

Hi all, allow the example to explain. This works:

cd /usr/local/builds/checkout/at_branch1/applications/AlphaTheoryWeb/
src/java/
zip -r /tmp/at_src.zip *
adding: com/ (stored 0%)
...

The problem: I can't change to a dir in a script running via cron - at
least it didn't seem to work. If I run this script:

#!/bin/bash

/usr/bin/zip -r /tmp/at_src.zip /usr/local/builds/checkout/at_branch1/
applications/AlphaTheoryWeb/src/java/*

exit

I get:
adding: usr/local/builds/checkout/at_branch1/applications/
AlphaTheoryWeb/src/java/com/

I don't want 'usr/local/builds/checkout/at_branch1/applications/
AlphaTheoryWeb/src/java/' part of the filenames , just com and below .
I did man zip , and after trying -j and -i I can't get the effect I
want. Any ideas ?



What's wrong with

#!/bin/bash

cd /usr/local/builds/checkout/at_branch1/applications/AlphaTheoryWeb/src/java
/usr/bin/zip -r /tmp/at_src.zip *

exit


You should be able to cd to the directory. If this doesn't work then send us the error message you get.

Good luck,

Steve

.