LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-23-2006, 08:17 PM   #1
somsahi
Member
 
Registered: Aug 2006
Posts: 44

Rep: Reputation: 15
cron job


Hi i have script
#!/bin/sh
cd /home/wasadmin/jar /usr/java/j2sdk1.4.2_12/bin/java -jar /home/wasadmin/jar/A.jar
echo hello

but in mail I am getting nothing except hello.
and jar is not working as expected from this script but from command line (/usr/java/j2sdk1.4.2_12/bin/java -jar /home/wasadmin/jar/A.jar)its working.
I am running this command from /home/wasadmin/jar directory


regards
 
Old 10-24-2006, 01:24 AM   #2
baikonur
Member
 
Registered: Oct 2005
Location: germany
Distribution: debian
Posts: 255
Blog Entries: 5

Rep: Reputation: 30
#!/bin/sh
cd /home/wasadmin/jar; /usr/java/j2sdk1.4.2_12/bin/java -jar /home/wasadmin/jar/A.jar
echo hello
 
Old 10-24-2006, 05:40 AM   #3
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
A few tips:
1. Try putting separate commands on separate lines, or, as suggested, put ";" to separate them.
2. Try running the script from command line before running it from cron.
3. When pasting code & commands on this forum, try enclosing them in tags. That makes it
much more readable.
4. You may need to set some environment variables (ie JAVA_HOME) for this script to work properly. You can do this at the top of your crontab settings, or by "source"ing your .bashrc (or other) file directly in the script.
 
  


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 the_rhino Linux - Newbie 10 10-02-2004 03:34 PM
CRON Job tommytomato Fedora 12 09-13-2004 12:38 AM
Cron job T-Rex Linux - Newbie 1 09-26-2001 11:28 AM

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

All times are GMT -5. The time now is 04:58 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