Jump to content

how do i do make a auto restart on Linux shh for a Minecraft server

hi i want to have my Minecraft server auto restart but i do not know how i'm using ssh.

Link to comment
Share on other sites

Link to post
Share on other sites

9 minutes ago, bitpoke said:

hi i want to have my Minecraft server auto restart but i do not know how i'm using ssh.

Just use shell commands. So 

/sbin/reboot

or

sudo reboot

for Ubuntu / Debian.

My build:

CPU

Intel Core i7 9700 8x 3.00GHz So.1151

 

CPU cooler

be quiet! Shadow Rock Slim

 

Motherboard

MSI B360-A PRO Intel B360 So.1151 Dual Channel DDR4 ATX

 

RAM

16GB (4x 4096MB) HyperX FURY black DDR4-2666

 

GPU

8GB Gigabyte GeForce RTX2070 WindForce 2X 3xDP/HDMI

 

SSD

500GB Samsung 970 Evo Plus M.2 2280

 

HDD

4000GB WD Red WD40EFRX Intellipower 64MB 3.5" (8.9cm) SATA 6Gb/s

 

Power Supply

bequiet! Straight Power 750W Platinum

 

Case

Fractal Design Define R6
3x bequiet! Silent Wings 3 PWM

Link to comment
Share on other sites

Link to post
Share on other sites

11 minutes ago, bitpoke said:

hi i want to have my Minecraft server auto restart but i do not know how i'm using ssh.

You want to write up an auto restart script, probably in bash if you're running a flavor of Linux. There's lots of options out there if you search for "Minecraft Auto Restart Script Linux" so feel free to take a look at a few before you decide on one.

https://stackoverflow.com/questions/62143022/how-do-i-automatically-restart-a-minecraft-spigot-server-in-the-event-of-a-crash

https://gitlab.com/dennislysenko/autorestart-v4/-/blob/master/README.md

Desktop: KiRaShi-Intel-2022 (i5-12600K, RTX2060) Mobile: OnePlus 5T | Koodo - 75GB Data + Data Rollover for $45/month
Laptop: Dell XPS 15 9560 (the real 15" MacBook Pro that Apple didn't make) Tablet: iPad Mini 5 | Lenovo IdeaPad Duet 10.1
Camera: Canon M6 Mark II | Canon Rebel T1i (500D) | Canon SX280 | Panasonic TS20D Music: Spotify Premium (CIRCA '08)

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, suedseefrucht said:

Just use shell commands. So 


/sbin/reboot

or


sudo reboot

for Ubuntu / Debian.

OP probably wants to restart the minecraft server, not the whole server itself.

mY sYsTeM iS Not pErfoRmInG aS gOOd As I sAW oN yOuTuBe. WhA t IS a GoOd FaN CuRVe??!!? wHat aRe tEh GoOd OvERclok SeTTinGS FoR My CaRd??  HoW CaN I foRcE my GpU to uSe 1o0%? BuT WiLL i HaVE Bo0tllEnEcKs? RyZEN dOeS NoT peRfORm BetTer wItH HiGhER sPEED RaM!!dId i WiN teH SiLiCON LotTerrYyOu ShoUlD dEsHrOuD uR GPUmy SYstEm iS UNDerPerforMiNg iN WarzONEcan mY Pc Run WiNdOwS 11 ?woUld BaKInG MY GRaPHics card fIX it? MultimETeR TeSTiNG!! aMd'S GpU DrIvErS aRe as goOD aS NviDia's YOU SHoUlD oVERCloCk yOUR ramS To 5000C18

 

Link to comment
Share on other sites

Link to post
Share on other sites

sudo crontab -e

 

add...

*/5 * * * * ./start_mc_server.sh

...to a new line

 

Save and quit

 

Linux will then check if the server is running every 5 minutes and if not will run the script you specified

Main Rig:-

Ryzen 7 3800X | Asus ROG Strix X570-F Gaming | 16GB Team Group Dark Pro 3600Mhz | Corsair MP600 1TB PCIe Gen 4 | Sapphire 5700 XT Pulse | Corsair H115i Platinum | WD Black 1TB | WD Green 4TB | EVGA SuperNOVA G3 650W | Asus TUF GT501 | Samsung C27HG70 1440p 144hz HDR FreeSync 2 | Ubuntu 20.04.2 LTS |

 

Server:-

Intel NUC running Server 2019 + Synology DSM218+ with 2 x 4TB Toshiba NAS Ready HDDs (RAID0)

Link to comment
Share on other sites

Link to post
Share on other sites

  • 1 year later...
On 9/17/2021 at 9:36 AM, Master Disaster said:

sudo crontab -e

 

add...

*/5 * * * * ./start_mc_server.sh

...to a new line

 

Save and quit

 

Linux will then check if the server is running every 5 minutes and if not will run the script you specified

Sorry for reviving this old thread, i put this in the crontab and changed the time to 10 minutes, but now it just runs the start file every 10 minutes instead of checking if its already active which in turn turns off the server, how could i fix that?

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×