By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,903 Members | 1,922 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,903 IT Pros & Developers. It's quick & easy.

problem in running shell script from cron

P: 26
#! /bin/bash



javac CopyFile.java
/usr/bin/java CopyFile



this is my shell script.when i call this script from terminal works fine.but through cron it gives me error saying exception i think it is not able to find the files that i have imported
such as
import java.io.*;
import java.util.*;
import java.lang.*;
import java.text.*;
import java.io.File;

help me out
Apr 15 '08 #1
Share this Question
Share on Google+
2 Replies


ashitpro
Expert 100+
P: 542
Have you redirected the output of your command...
Do it first and post the content of that file here...
Apr 15 '08 #2

gpraghuram
Expert 100+
P: 1,275
#! /bin/bash



javac CopyFile.java
/usr/bin/java CopyFile



this is my shell script.when i call this script from terminal works fine.but through cron it gives me error saying exception i think it is not able to find the files that i have imported
such as
import java.io.*;
import java.util.*;
import java.lang.*;
import java.text.*;
import java.io.File;

help me out
Check whether the JAVA path is set properly.
Try to write a small shell script and then set the JAVA path in it and then call the commad.
Set this shell script in a cron and i think it will work

Raghuram
Apr 15 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.