HenryLoke
HenryLoke

Reputation: 67

Crontab not able to Run jar file

By running:

00 01 * * 1 root /usr/bin/java -jar /home/export/export.jar

Output: the scheduler will fail to wake up.

Then I changed it to:

00 01 * * 1 root /usr/bin/java -jar /home/export/export.jar > /home/export/cron.log 2>&1

It worked!

Can I do this without exporting to the file - cron.log?
I did used log4j to log the process; cron.log is a duplicate log for me.

Upvotes: 5

Views: 7861

Answers (1)

Patrice M.
Patrice M.

Reputation: 4319

You can replace with /dev/null , as in:

00 01 * * 1 root /usr/bin/java -jar /home/export/export.jar > /dev/null 2>&1

Upvotes: 1

Related Questions