It restart WHOLE server, not a resource.
well MAYBE you should try and code this yourself then?
My server just crashes when it comes back up using this
maybe increase the pause time?
Is there any way to say in a chat message for example âServer restarting in less than 5 minutes you should log outâ or in the console ?
Thanks
Any server restart that works for the latest version of FiveM? I have no idea how to do auto server restarts on ubuntu 16
how you do a server restart on fxserver linux?
bump, any way to do this on fx?
Insert this into run.bat
:loop
timeout /t 1
@RD /S /Q âC:\FXServer\ServerData\cacheâ
start C:\FXServer\run.cmd +exec server.cfg
timeout /t 14400 >null
taskkill /f /im FXServer.exe >null
goto loop
then go out drinking with friends celebrating your new freedom
im on linux
How ever i did make my own restart script from scratch after 3 hours of research
Thanks!
CruelAlpha, care to share? Iâve been trying to figure out a script to restart my fxserver and with my very very basic knowledge of linux, I have yet to be able to create one.
After i start my server i have to manually restart sessionmanager, is there a way of doing that in auto restarts?
Ok, so this should be as complete as it needs to be.
2 Hour Restart, Cache Flush, Session Manager FIX, Console Spam FIX & Countdown timers.
For this to function youâll need to edit server.cfg in the root of the FiveM Server Folder in this case, C:\FXServer add this line near the bottom of the file " restart sessionmanager " NOTE !NO QUOTATIONS! Save the file & completed.
Now copy this directly into your Server_Start.cmd paste & save file
:loop
@echo Clearing Server Cache Files
timeout /t 3
cd %FXServer%
rd /s /q cache
timeout /t 1 >nul
@echo off
cls
@echo Hit Enter In This Window To Restart Server Immediately, Keep This Window Open For Automatic 2 Hour Server Restarts.
start âFMServerâ C:\FXServer\run.cmd +exec server.cfg
timeout /t 7200
taskkill /f /im FXServer.exe
@echo Server Shutdown Successfully.
timeout /t 2 >nul
taskkill /f /fi âWindowTitle eq FMServerâ
@echo Server Is Restarting Now.
timeout /t 10
goto loop
Why are you flushing cache folder every time the server autorestarts? There is literally no need.
Anyone have an idea on how to do this with multiple servers? What would i need to rename and change to do this? I have 3 servers and it kills the wrong ones sometimes just gets very confusing.
start âFMServer1â C:\FXServer\run.cmd +exec server.cfg
start âFMServer2â C:\FXServer\run.cmd +exec server.cfg
start âFMServer3â C:\FXServer\run.cmd +exec server.cfg
Should be able to naming them individually
And to kill tasks
taskkill /f /fi âWindowTitle eq FMServer1â
taskkill /f /fi âWindowTitle eq FMServer2â
taskkill /f /fi âWindowTitle eq FMServer3â
I see thank you man appreciate it.
:loop
@echo Clearing Server Cache Files
timeout /t 3
cd %FXServer%
timeout /t 1 >nul
@echo off
cls
@echo Hit Enter In This Window To Restart Server Immediately, Keep This Window Open For Automatic 2 Hour Server Restarts.
start âserver2â C:\server2\run.cmd +exec server.cfg +exec smsp.cfg +exec smst.cfg
timeout /t 7200
taskkill /f /im FXServer.exe
@echo Server Shutdown Successfully.
timeout /t 2 >nul
taskkill /f /fi âserver2â
@echo Server Is Restarting Now.
timeout /t 10
goto loop
Would that work if my directory is server2?
It seems i get an error with this below
:loop
@echo Clearing Server Cache Files
timeout /t 3
cd %server2%
timeout /t 1 >nul
@echo off
cls
@echo Hit Enter In This Window To Restart Server Immediately, Keep This Window Open For Automatic 2 Hour Server Restarts.
start âserver2â C:\server2\run.cmd +exec server.cfg +exec smsp.cfg +exec smst.cfg
timeout /t 7200
taskkill /f /im FXServer.exe
@echo Server Shutdown Successfully.
timeout /t 2 >nul
taskkill /f /fi âserver2â
@echo Server Is Restarting Now.
timeout /t 10
goto loop