I've created an openshift app called "java" with the following cartridges:
- Tomcat 6 (JBoss EWS 1.0)
- Cron 1.4
I have a pulled the app into my local directory and added directory "lib" and my executable "testapp.jar".
..\java\src\main\webapp\lib\testapp.jar
I added a 'minutely' cron job file called "java"
..\java.openshift\cron\minutely\java
I successfully committed the directory and the cron file. But the cron job keeps failing to find and execute the testapp.jar.
I tried the following two scripts:
java -jar $OPENSHIFT_HOMEDIR/src/main/lib/testapp.jar
java -jar $OPENSHIFT_REPO_DIR/lib/testapp.jar
Neither works and I keep getting a message that testapp.jar can't be found.
So clearly, my reference is incorrect. Apparently, I should be using OPENSHIFT_DATA_DIR as it's the only persistent directory.
I would like to ask for help with the cron script as I am not having much luck referencing (executing) my testapp.jar.
Could anyone please give me an example of how to correctly reference reference the testapp.jar using the OPENSHIFT_DATA_DIR environment variable?