User Script for docker containers


7 posts in this topic Last Reply

Recommended Posts

  • 2 months later...

I am doing this same thing (except I am pausing and unpausing my dockers). When I run the scripts manually, they work as expected. However, I was trying to use the custom scheduler so they would run at specific times on specific days, but I realized last night when I checked it that the script didnt run at the scheduled time. Is the cron system on a specific timezone or is it based on my timezone? Is there something I am missing?

Link to post
  • 3 months later...

I have a question regarding using the docker stop command on an ARK Game Server docker.  I have issued this command manually from the console and it did in fact stop the docker as expected, however, when I checked the time stamps of the save game folder the world had not been saved before the docker stopped.  Just to be sure I verified this by going into the game and building some structures then quitting the game, issued the docker stop command and then the docker start command.  When I went back into the game none of the changes I made before the docker restart had been saved.  I have the auto save set for 20 minutes so at most 20 minutes of game data could be lost when the docker is stopped and restarted.  I was under the impression that by stopping the docker the game would automatically save before stopping the server as I was thinking the stop command was a clean shutdown of the game server docker.

 

Is there a way to save the game right before the server docker is stopped/restarted?  I can use an RCON client to force the world to save but I was hoping for an automated solution to ensure the game is saved before the server is stopped/restarted.  I have a daily backup script but want to add to that daily routine a server restart to ensure the server is always up to date.

 

Any help would be greatly appreciated.

Link to post
On 12/23/2020 at 2:04 AM, DBone-Unraid said:

 I was under the impression that by stopping the docker the game would automatically save before stopping the server as I was thinking the stop command was a clean shutdown of the game server docker.

This is completely dependent on how the docker container was implemented, but in my experience container most container authors rarely go the extra mile to trigger a game save on shutdown.

 

On 12/23/2020 at 2:04 AM, DBone-Unraid said:

Is there a way to save the game right before the server docker is stopped/restarted?  I can use an RCON client to force the world to save but I was hoping for an automated solution to ensure the game is saved before the server is stopped/restarted. 

Is there perhaps a CLI RCON client? If so you could perhaps script triggering the save via the RCON Client. I would imagine if you found one it would be in a docker container. So you would use a docker run command in your user script to run the RCON client save in a autoremoved container before shutting down the server container. 

 

Alternatively if ARK the game has options to autosave on close (maybe a command flag or config file) you could look into using one of those with the container.

Link to post

Thanks so much for the ideas.  Currently I have the auto save feature in the game server set to save every 20 minutes so the most I would lose is 20 minutes worth of game play.  Also, since I'm dong the backup at 5am which is when I want to trigger the server restart I should never have to worry about losing any progress as I'm almost never playing the game at or anywhere close to that time and the server is a private server with all players in the same timezone and with similar schedules.  I will definitely look into a command line RCON client/docker as that would be handy just to ensure the game is saved prior to the update/restart.

 

Thank you.

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.