View Single Post
  #18  
Old June 10th, 2007, 09:09 AM
lch's Avatar

lch lch is offline
General
 
Join Date: Feb 2007
Location: R'lyeh
Posts: 3,861
Thanks: 144
Thanked 403 Times in 176 Posts
lch is on a distinguished road
Default Re: Automatic backup of turn files

Nice python scripts, thanks.

I have been using some crude bash scripting myself, you could drop this in your ~/.bashrc if you dare:

Code:
function archive {
if test $# -lt 1; then return; fi
tar czvf $(basename $1)-$(date +%s).tgz $@
}

function archive-title {
if test $# -lt 2; then return; fi
argv=($@)
tar czvf $(date +%s)-$1.tgz ${argv[@]:1}
}


The first "archive" command takes as parameter the path to your game in your savegame directory (you could chmod into the savegame directory first to save typing) and adds a timestamp to the archive, the second "archive-title" command expects some title as first parameter for the savegame and prefixes it with a timestamp (in case you want to have a better view over what the savegame is about, like "SpammedMindHunt").

Yes, that code is ugly and I never went around to improve it, so you better use the python script instead.
__________________
Come to the Dom3 Wiki and help us to build the biggest Dominions-centered knowledge base on the net.
Visit my personal user page there, too!
Pretender file password recovery
Emergency comic relief
Reply With Quote