I have a Minecraft server that I start over ssh. I use screen so it keeps running
Spigot allows you to set a start script so that if the server stops it can start again automatically.
I currently have the following code for my spigot start command (this is inside a shell file that spigot runs)
#!/bin/sh
screen -s minecraft -x ~/path/to/server/start.shthen in my start.sh file I have the following
#!/bin/sh
java -Xmx1500m -jar server.jar -noguibefore I started with the restart I would ssh into the computer, start screen then run the start.sh file. But now I need a file that will start screen and run the start.sh file
How do I do this?
11 Answer
-X Execute <cmd> as a screen command in the specified session.
-x Attach to a not detached screen. (Multi display mode).what i did was see the -X flag and made 2 mistakes
the first was to use lowercase x not an uppercase X
the second was that you don't need the -X flag, and you can just use
screen -s minecraft ~/path/to/the/start.shand give the command or file as an argument without the flag