954,228 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Confusing but simple problem

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.

cwarn23
Occupation: Genius
Team Colleague
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
 

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.

cwarn23
Occupation: Genius
Team Colleague
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: