The International Simutrans Forum

Community => Game Servers => Topic started by: moblet on December 28, 2014, 04:06:20 AM

Title: How do I implement automated backup and restart in Linux?
Post by: moblet on December 28, 2014, 04:06:20 AM
One for the Linux experts. I'm no Linux expert and am about to start hosting games on a Linux machine. I figure someone might have done this before and can show me how to do it.
Title: Re: How do I implement automated backup and restart in Linux?
Post by: DrSuperGood on December 28, 2014, 04:29:02 AM
This (http://superuser.com/questions/507576/how-to-automatically-restart-a-linux-background-process-if-it-fails) thread has some ideas how to get an automatic restarting process.

Start the server using a bash script which copies the server map before starting simutrans to another directory. You will want to give it a unique name (so backups are not deleted) however I am unsure how to do that simply. You might also want some script which runs every 3-6 hours or so which copies the map save to another "periodic" backup.
Title: Re: How do I implement automated backup and restart in Linux?
Post by: Michael 'Cruzer' on December 29, 2014, 08:34:50 AM
Simplest solution: Create cron-triggered bash script which copies the game to "/somedir/savegame_$date" and then create another script which deletes all files in "/somedir" which are older then x-days.