Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 10-23-2006, 08:17 PM   #1
Registered: Aug 2006
Posts: 44

Rep: Reputation: 15
cron job

Hi i have script
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

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

Rep: Reputation: 30
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
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

All times are GMT -5. The time now is 07:46 PM.

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