Hi guys I am trying to get my Minecraft server to startup with my server. I will use cron once I figure out what the proper commands are. I want Minecraft to start in a new screen titled "Minecraft" and I want to have a command sent to this session that starts the server. Every morning at 3AM I want to send the command "stop" to stop the Minecraft server and then send the command to start the server (Minecraft gets buggy if it isn't restarted every once in a while). I was playing around with the screen options and I got Minecraft to start for a few seconds and screen killed it. From what I am reading online this command should work.
screen -dmS Minecraft java -Xmx12G -Xms12G -jar /home/alan/minecraft/forge-1.16.5-36.2.30.jar --nogui
I want to reattach to this session to type commands or restart the Minecraft server because I made a change. All of the commands I ran didn't work I type "screen -ls" and my "Minecraft" session isn't there. I know how to use cron, but I clearly don't understand screen. We have frequent power outages in my area, so I have a UPS shutdown my server and a Raspberry PI turns it back on when power is restored. It would be nice to include Minecraft to my startup. After that, all of my services will start and stop automatically without my intervention.