0

I have a game server that I would like to manage restarts automatically

Currently I am doing this to run the server

screen -dmS screenname // create a new screen
screen -xs screenname // attatch to screen
bash ~/start.sh

Every few hours this program will crash and I'll have to SSH in to run this manually.

Is there a way I can possibly have .sh auto boot if it detects it goes down?

1 Answers1

0

There are Some server crash file(mean if server crash this file will be execute)
CREATE your bash file
Or place command in that file(script)
whenever crash happen, your file automatically Run


OR

Next start up(whenever a OS start it run some applications that mention in startup for os like:start wifi something like that)

$ cd ~ #home dir
$ touch AutoRun.sh   #Create AutoRun.sh file
$ nano AutoRun.sh /vim AutoRun.sh
      #paste Your Command there here
      screen -dmS screenname // create a new screen
      screen -xs screenname // attatch to screen
      bash ~/start.sh
$ crontab -e
  # Adding a line like this to it:
  @reboot ~/AutoRun.sh
  #### ⬇️⬇️⬇️ for reference about ⬇️⬇️⬇️

Follow up this link :::: Click me