problem in running shell script from cron

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smitanaik
    New Member
    • Oct 2007
    • 26

    problem in running shell script from cron

    #! /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
  • ashitpro
    Recognized Expert Contributor
    • Aug 2007
    • 542

    #2
    Have you redirected the output of your command...
    Do it first and post the content of that file here...

    Comment

    • gpraghuram
      Recognized Expert Top Contributor
      • Mar 2007
      • 1275

      #3
      Originally posted by smitanaik
      #! /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

      Comment

      Working...