aspose file tools*
The moose likes Linux / UNIX and the fly likes Crontab for running executable jar is not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Crontab for running executable jar is not working" Watch "Crontab for running executable jar is not working" New topic
Author

Crontab for running executable jar is not working

SaiManasa Dasari
Ranch Hand

Joined: Aug 21, 2012
Posts: 32
Hi
I added following entry in the crontab to run the executable jar for particular time.

07 15 * * * root /usr/bin/java -jar /home/localhost/UpdateJarFolder/Update.jar
Update.jar is my executable jar..My problem is its not running this executable jar..In logs it is showing as

Jan 7 15:00:01 smdasari CRON[6528]: (root) CMD (/usr/bin/java -jar /home/localhost/UpdateJarFolder/Update.jar)
Jan 7 15:00:01 smdasari CRON[6527]: (CRON) info (No MTA installed, discarding output)

Is MTA required for running executable jar??It is working fine for executing the command from shell.I am using Ubuntu Os.Please help me to solve this.

Thanks in advance.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16070
    
  21

MTA stands for Mail Transfer Agent, I think, so apparently the app runs, but cannot use its email services.

I recommend that when running Java via cron that you place the actual Java command in a script file and let cron run the script instead. It makes things a little simpler. You can run the script directly for debugging purposes (which is something I spent too much time doing just the other day!).


Customer surveys are for companies who didn't pay proper attention to begin with.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Tim Holloway wrote:MTA stands for Mail Transfer Agent, I think, so apparently the app runs, but cannot use its email services.


I think the message is from cron actually -- it wants to mail you the output from the Java program, but it can't, because it can't find an MTA.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Crontab for running executable jar is not working