I want to execute a command in a new screen session (and detach from it) but I don't get it to work. I tried to start a process in a new screen session and detach from it with this:
screen -d -m mycommmand
But when I try to attach to that screen session with
I get the message "There is no screen to be resumed". I also tried to start a command in a new screen session with
When I do that, a new screen session starts but the command doesn't get executed.
The command is a .sh script that starts a game server but the game server doesn't start.
[Edit] Because some people asked for the exact command, here it is: It's a bash script that should start a minecraft server in a seperate screen session.
Here is the .sh script:
cd "/home/tim/minecraft/survivalServer" screen -S "minecraft-server-1-14-4" -m -d /home/tim/java/bin/java -Xmx4096M -Xms1024M -jar /home/tim/minecraft/survivalServer/minecraft_server.1.14.4.jar nogui
Now, the problem is, that when I run the script it fails to create the new screen session. Why is that?
Help is much appreciated. Thanks