Question About Screen Command
I run a game server for a game called Minecraft, and its all running through a Linux (CentOS 5.5) VPS. I have the server set up perfectly. I run hourly backups of the server map (you don't need to know what that is), and I use an executable shell file to do so. My current one is:
This sends the printf command to the (detached) screen that it's running in, and executes the command (for the game) called 'save-all'. That is working correctly. However, when I use the same command like so:
screen -x server -X stuff `printf "save-all\r"`
zip `date "+%Y-%m-%d-%H-%M-%S"`.zip -r ./* -x \*.zip
(The command for the server console here is 'say <message>', which outputs a message to all players in the server)
screen -x server -X stuff `printf "say testing\r"`
Nothing happens. I suspect that it is a problem with the spaces inside the command, but I can't get anything to work.
I then noticed that this code:
Actually prints the <command> (in this case, 'say testing') into the console, but doesn't execute it. It needs to send the enter key (what I assume here to be a newline key).
screen -x server -X stuff '<command>'
Anyone know what I should do?