.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $5.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 3: The Awakening

Reply
 
Thread Tools Display Modes
  #1  
Old September 24th, 2009, 04:04 AM

Ornedan Ornedan is offline
Private
 
Join Date: May 2008
Posts: 29
Thanks: 3
Thanked 4 Times in 4 Posts
Ornedan is on a distinguished road
Default Re: Linux Admining

Quote:
Originally Posted by Lihaässä View Post
Code:
#!/bin/bash
rsync -a /home/dom/dominions3/savedgames/ /home/dom/dominions3/backup/
I see a couple of problems here:
  • You copy all games every time any game hosts. Which clobbers the backups of all games other than the one about to be hosted.
  • You only maintain a backup of the latest turn. This will cause trouble when the game manages to **** itself up so that it crashes at next hosting, because by the time you notice it crashing, you've clobbered the backup from before it broke.
    (Yes, this can happen. Guess what made me think it was a good thing I was already backing up all truns?)

If you look approximately halfway up the thread, I've posted a backup script that has neither of those particular issues.
Reply With Quote
The Following User Says Thank You to Ornedan For This Useful Post:
  #2  
Old September 24th, 2009, 08:52 AM
Lihaässä's Avatar

Lihaässä Lihaässä is offline
Corporal
 
Join Date: Jan 2009
Location: Espoo, Finland
Posts: 147
Thanks: 23
Thanked 2 Times in 2 Posts
Lihaässä is on a distinguished road
Default Re: Linux Admining

You are correct, the script is simple but easily altered to backup only one game.. in this case /home/dom/dominions3/backup/Rivers/
I hope that the game won't crash and use this one.

Your script was too much for me and I didn't understand it. Thanks for your input. I will look it again when I find the time.
Reply With Quote
  #3  
Old September 24th, 2009, 09:24 AM

Ornedan Ornedan is offline
Private
 
Join Date: May 2008
Posts: 29
Thanks: 3
Thanked 4 Times in 4 Posts
Ornedan is on a distinguished road
Default Re: Linux Admining

Most of my backup script is about finding the current turn number and handling edge cases like being somehow called to backup a non-existent game (not detecting conditions like that will at best result in the script crashing and at worst data loss as it goes blindly ahead to do something stupid).


Doing
Code:
--preexec /home/dom/backup.sh "$GAME"
and
Code:
#!/bin/bash
rsync -a "/home/dom/dominions3/savedgames/$1" /home/dom/dominions3/backup
would have your backup command be parametrised by game name, so it'll backup each game to separate directory. Though I guess that might have been what you meant?
Reply With Quote
The Following User Says Thank You to Ornedan For This Useful Post:
  #4  
Old September 24th, 2009, 10:23 AM

Ornedan Ornedan is offline
Private
 
Join Date: May 2008
Posts: 29
Thanks: 3
Thanked 4 Times in 4 Posts
Ornedan is on a distinguished road
Default Re: Linux Admining

Looks like edit period ran out... It should have been
Code:
--preexec "/home/dom/backup.sh \"$GAME\""
Reply With Quote
  #5  
Old September 24th, 2009, 10:48 AM
Lihaässä's Avatar

Lihaässä Lihaässä is offline
Corporal
 
Join Date: Jan 2009
Location: Espoo, Finland
Posts: 147
Thanks: 23
Thanked 2 Times in 2 Posts
Lihaässä is on a distinguished road
Default Re: Linux Admining

It works perfectly!
Reply With Quote
Reply

Bookmarks

Tags
admin, automation, command line, hosting, linux, script, server, switches

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 08:44 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.