LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-20-2006, 06:57 PM   #1
somsahi
Member
 
Registered: Aug 2006
Posts: 44

Rep: Reputation: 15
jar through cron job


Hi I have to run cron job for which a.sh file is below.
jar file is in
/home/wasadmin/jar.Both a.ct and a.sh is also in same jar folder
now issue is if i run this jar through cron nothing is happening as
application is not able to get application properties.
but if i run this command from /home/wasadmin/jar folder it is running perfectly(means not through cron). any idea as i need to run through cron
/usr/java/j2sdk1.4.2_12/bin/java -jar /home/wasadmin/jar/A.jar
any idea.

a.sh file
#!/bin/sh
/usr/java/j2sdk1.4.2_12/bin/java -jar /home/wasadmin/jar/A.jar
echo hello
a.ct
* * * * * /home/wasadmin/jar/a.sh
 
Old 10-21-2006, 06:30 AM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
You could either modify your existing sh script or wrap this one in another one where you first cd to the required directory.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cron job somsahi Linux - Software 9 10-05-2006 02:19 PM
Cron job rust8y Linux - Newbie 3 05-18-2006 09:06 AM
cron job? dr_zayus69 Linux - Newbie 14 12-01-2004 06:16 PM
cron job working2hard Programming 6 07-28-2004 09:12 PM
Cron Job imanahmadi Linux - Newbie 1 07-03-2003 11:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration