Teams reset after vps restart

Hello all!
I would really appreciate your help, i can't find any new information that can help me regarding this issue.

I have set a crontab to run every 8 hours and it resets the entire vps server which serves my rust server.
Then when it loads back up i have a startup script that runs it again and the game server is getting back up.

It all works perfectly and i enjoy a full vps reset that clears all other garbage from the ram.

The only issue i have is that after each reset teams are being deleted.
For example if i set a new team in game and then invite a player to it, after a reset there is no team like i never created it.
Just a side note that team members are not dead while reset.

What i did to try and fix it is to create a shell script that runs on the root folder and prints the latest edited files on the server.
Then i have created a new team and added a new player to it, then ran that script and i could see that there was and edit to the /server/server_identity and /oxide/data folders.

server_identity holds database data and oxide/data has some .data files.

Next i added to my server restart script few extra commands which first make a copy of those folders to an other directory called backups and after the server reset paste those back to their relative locations.

This way i make sure that any data that occurred prior to the reset will persist.

And guess what, it doesn't.

Teams are still being reset, i have no idea how it is stored then.

Is that a client side thing? no way it is.. and if it isn't then in which file is it being saved?

This drives me crazy.. 

Thanks for your help!

You are forcefully killing the RustDedicated process which is the wrong way to do it. You should be issuing the 'quit' command to the rustserver so it shuts down gracefully - better still, issue 'kickall yourmessage' then 'quit'. I'm not sure if this would cure your teams issue but I suggest you try it and see.

Your next question is "how do I issue the quit command via a cron job?" - there are fancy ways to achieve this, but the simpler method is to use a plugin to issue the kickall/quit commands, then use your cron job only for the startup phase. The TimedExecute plugin would do the job for example. Or else just search the word 'restart' and there are several 'restart' plugins, none of which are able to start the server, only stop it(!)

Merged post

Instead of kickall/quit (this is my personal preference) you could use the 'restart' command instead, it does the same as quit but with a delay and chat message to players:

restart <seconds> <message>