Crontabs and .sh files can be used to start/stop/restart your server and also detect crashes.
IMPORTANT
Crontab tasks can be added by running "sudo crontab -e" in your VPS, then adding the code.
.sh files should be put in the server's root directory for the below scripts to work. (i.e. where the "mods", "logs", "world", etc folders are)
Crontab tasks can be added by running "sudo crontab -e" in your VPS, then adding the code.
.sh files should be put in the server's root directory for the below scripts to work. (i.e. where the "mods", "logs", "world", etc folders are)
- To create .sh files, you can use a FTP client (Filezilla), or research another way
- To run start.sh, for example, cd to its directory in the VPS then run "sh start.sh"
Detect crashes
Update the paths in the code. The paths start from the very top root directory of your VPS.
You can also check for other key words too if you're finding your server crash and not starting back up
Add to crontab tasks by running the command:
sudo crontab -e
sudo crontab -e
Restart server (restart.sh file)
This assumes your screen name is "Minecraft" you can change this if you use a different screen name. (See step 10 of the VPS page)
restart.sh
Add to crontab tasks by running the command:
sudo crontab -e
sudo crontab -e
Start server (start.sh file)
REPLACE "-Xms4G -Xmx8G -jar forge-1.15.2-31.2.57.jar" with your own startup script with the correct ram limits, and forge file name.
This assumes your screen name is "Minecraft" you can change this if you use a different screen name. (See step 10 of the VPS page)
start.sh
Stop server (stop.sh file)
This assumes your screen name is "Minecraft" you can change this if you use a different screen name. (See step 10 of the VPS page)
stop.sh