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!