deivik Posted June 16, 2022 Share Posted June 16, 2022 I am looking for how to put an auto restart on my server 7 days to die in linux, either due to a crash or that every 12 hours it restarts itself Thanks in advance, regards Link to comment Share on other sites More sharing options...
meganoth Posted June 17, 2022 Share Posted June 17, 2022 I use two scripts that I call in crontab: One to start a server is rather trivial: #!/bin/sh cd ${HOME}/CURRENT/ nohup ./startserver.sh -configfile=serverconfig.xml &>/dev/null & The one to stop the server needs the servers telnet access: #!/usr/bin/expect set timeout 20 spawn telnet localhost <YOUR TELNET PORTNUMBER> expect "Please enter password:" send "<YOUR TELNET PASSWORD>" expect "Press 'help' to get" send "shutdown\r" sleep 15 send "exit\r" If you want to restart immediately after a crash, crontab naturally won't help that much. In that case you need some script checking if the server is still running aka a watchdog that then calls the start script. There are also at least 2 server managers from modders available that probably do this type of thing as well. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.