-1

Hi, I am trying to set up a cron job to load up an application on my server every two hours. I have the following code which works successfully from the terminal but does not run from cron even though it is running as the same user and I have even tried giving the user root privalages on the cron job. Below is my bash file "minecraft.sh"

#!/bin/bash/
cd /home/minecraft
java -Xincgc -Xmx2250M -jar craftbukkit-1.0.1-R1.jar

Then in the cron job just like in the terminal I use the following command.

bash /home/minecraft/minecraft.sh

Can somebody please help me solve this as it is annoying the hell out of me as this is a really big problem for me. Anybody know what might be happening? Thanks.

1
Contributor
1
Reply
2
Views
5 Years
Discussion Span
Last Post by cwarn23
0

I think I solved it by using the following:

#!/bin/bash/
cd /home/minecraft
screen -dmS minecraft java -Xincgc -Xmx2250M -jar craftbukkit-1.0.1-R1.jar

hope that helps future generations.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.