crontab wont work - runs manually fine
Any idea, 2 days ago everything was fine
I then added a properties file to my java program and cant get the program to run. runs fine when ran script manually from root, however does not run through crontab any more. do the property files need adding to root too or can they run from the same place as my programs? please help! |
Hi, welcome to LQ!
What does the invocation on the command-line look like, what does it look like in crontab? Please post both in code tags ... [ CODE ] [ /CODE ] ... w/o the spaces between the brackets and the words CODE and /CODE ... Cheers, Tink |
http://www.linuxquestions.org/questi...y-fine-822645/
sorry i was away for 2 weeks, the code is stored as above |
Is it because when you run the shell script you are in a different directory to the home directory for the user for the crontab running of the script? Maybe you should specifically cd to the directory at the start of your script.
You could add something to your Java application to list all the System properties - that could give you more information to work with. |
Post #4 is correct. The line below is your problem:
Code:
props.load(new FileInputStream("test10.properties")); When run from the root crontab; the application will look for /root/test10.properties - rather explicitly specify the location in your code. Alternately there are build tools out there that will build your properties file into your JAR. |
thanks
thats perfect i changed to the //home exact location in my java and now works.
strange it didnt pick up the file though as it was in my .jar build as test.properties thanks guys |
All times are GMT -5. The time now is 03:59 PM. |