[Release] Auto Restart Server

When restarting the server, if the cache is cleared, the server takes longer to load as a new cache folder has to be created as well as the resources your server has needs to be stored inside said cache folder.

Prevention of what, exactly? Again, there is no valid reason to clear your servers cache after every restart.

I work on a server with a map of 6gb, and the server does not take more than 4 seconds to start, even if I delete each time.

And against the prevention of corruption, then a big cache idle the server. It does not cost anything to erase the cache. And if it bothers you so much, you have case clear the lines that remove the cache I would not like you.

when i use this code i get an error that it cant find an valid lisence key

Have U an run.cmd file in FiveM directory? Or something else :slight_smile:

does it work for linux root ?

No, this is only for windows system.

hmmm, i just put my directory way on the line where my start.cmd is.

start "FIVEM SERVER" %location%run.cmd +exec server.cfg %*

Change the run.cmd to start.cmd in this line. Sorry i have run.cmd :slight_smile:

yes i dit that but now it say cant find the path
image

I’m aware, it’s a bug that appears in some people without me really knowing why … I had this bug on my side, and to solve it I just copied that instead of the old code :

set location=C:\FXServer\

:: CONFIGURATION

:start

set dat=%date:~6,4%-%date:~3,2%-%date:~0,2%
set backup=%location%logs%dat%.txt

:: Partie sauvegarde

echo [%time%] - Serveur ouvert
echo [%time%] - Serveur ouvert >> %backup%
echo [%time%] - Lancement de la sauvegarde
echo [%time%] - Lancement de la sauvegarde >> %backup%
xcopy %location%“resources” %location%\backups"%dat%" /E /H /R /Y /I /D >> %backup%
echo [%time%] - Sauvegarde termine
echo [%time%] - Sauvegarde termine >> %backup%

Try to change your directory path first only, to see if it’s will working or not. And if it work, translate it if you want

I did not understand line 25, do I have to by the directory of the server folder?

You are likely setting an improper starting directory. That would cause the exact issue you’re having.

I’m french too, mais sur ce forum faut parler anglais … Langue international l’oblique

Anyway, in the launch part, line 48, replace by
start% location% run.cmd + exec server.cfg% *

Don’t use this guys. It deletes all of your files.

4 Likes

it not delete the entire files of your server,
it happen because you wrong with change the directory of cache in the cmd :slight_smile:
you must becareful with yourfolder /cache/files
don’t change it with just yourfolder because it will delete your folder

Step 1) read instructions

Step 2) Use your backup files when you delete your server because you didn’t read the instructions.

Step 3) You don’t have backup files, do you?

1 Like

Hi i have just installed this and i do not make scripts i only edit them to sute as most, but i can tell you this much, This Does Not Delete Any Files ONLY Cache files so Stop Bitching and Read what you have been told to do then this will work as is should do. Random_0100 Thank you for this script. P.S Backup server manually its good practise to make Backup on to another drive for safety

1 Like

Hello everyone. I have tried to put this on my server but I can’t make it work. So a question to you, does the set reboot mean that it is in 6 hours or that it is at 06.00 in the morning?

Yes i mean 6 is 6:00 AM and 18 is 18:00 PM

People should really start backing their shit up more frequently. Specially when using shitty vps providers or giving their access credentials to 14 year olds.