2

I have a shell script on FreeBSD that sends a few screen stuff commands to a running screen session (which runs a Minecraft server). The commands work when I execute it manually.

But if I put the same script into the same user's crontab, it does execute but the screen stuff commands don't reach the running screen process.

I've checked /var/log/cron and even >>'d output to a log file and I saw that the parts of the script that have nothing to do with the screen commands do actually execute.

My shell script looks like this:

screen -S minecraft -X stuff "say Server is going to render the world now. " screen -S minecraft -X stuff "say You might feel some slight turbulence. " screen -S minecraft -X stuff "save-all " screen -S minecraft -X stuff "save-off " cd /home/minecraft/bin/mcmap-src ./mcmap /srv/minecraft/cascada screen -S minecraft -X stuff "save-on " 

Can anyone help me with this?

[EDIT]

Oops it turns out it has nothing to do with the executing user, but everything with having to use the path "/usr/local/bin/screen" instead of just "screen".

Fixed!

2
  • 3
    Please convert your edit into an answer for you question and when you can accept it - thanks Commented May 11, 2011 at 12:18
  • I always remember to use the full path instead of just command name in the cron job. Commented May 28, 2011 at 17:39

1 Answer 1

1

From the edit to the question.

It turns out it has nothing to do with the executing user, but everything with having to use the path "/usr/local/bin/screen" instead of just "screen".

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.