Incredible, but true. I did write some documentation, completely
voluntary, without someone threatening me with a shotgun.
Here's the readme of the new version:
Code:
*Synopsis*
A python script to auto-backup your dom3 games
*Requirements*
python 2.4 or better. Get it from http://www.python.org/download/. If you have Civ 4,you have it
(I hope 
zlib. Get it from http://gnuwin32.sourceforge.net/packages/zlib.htm. Linux has it (usually)
*Installation*
- extract dom3backup.py to your dominions3 directory
- Linux:
create a shell script like:
#!/bin/bash
./dom3 --scoredump --preexec './dom3backup.py -q' &
chmod +x <your name goes here> business as usual
-Windows:
-create a link of your dom3.exe (right drag to a location of your choice and select 'create link here')
-right click on your link, select 'properties' and find the line containing 'dom3.exe'
-add ' --scoredump --preexec "<Dom3 path>\dom3backup.py -q"'
the ' are only there to show blanks, don't enter. The " however are required.
-enter further arguments. Explained below
-Mac:
sorry, no idea
*Usage*
dom3backup always backups the game, you've last played. If you want to backup another game, use the
-g option.
dom3backup uses a simple substitution. Whenever you specify a directory, #name is replaced with the
current game name (either last game played or specified with -g), #turn is replaced with the
current turn-number.
Relative paths are relative to <dom3>/savedgames
-a ARCHIVE, --archive=ARCHIVE
create archive <name> now. Usually used from the commandline
-b BACKUPDIR, --backupdir=BACKUPDIR
create backup in backupdir. Default:
<dom3>/savedgames/#name.backup.
Example:
last game you played was 'ermor1'
no arguments:
backup all your files to <dom3>/savedgames/ermor1.backup/
-b ./#name/backup
backup all your files to <dom3>/savedgames/ermor1/backup/
-b c:/d3archive/#name
backup all your files to c:/d3archive/ermor1/
-b ../saved/#name.#turn
all your files to '<dom3>/saved/ermor.1',then <dom3>/saved/ermor.2' etc.
-b ../saved/#name/#turn
all your files to '<dom3>/saved/ermor/1',then <dom3>/saved/ermor/2' etc.
-d ARCHDIR, --archdir=ARCHDIR
create Zipfiles in archdir. archdir must exists.
Default: <dom3>/archivedgames. Absolute or relative paths as the -b option
-f FREQ, --freq=FREQ create a Zipfile every <n> turn(s). Default: 0 (no
zipfile)
-g GAME, --game=GAME backup game <name>. Otherwise backup latest game
-m MAXFILES, --maxfiles=MAXFILES
keep max. <n> Zipfiles. Delete oldest. Default: 0
(keep all)
-q, --quiet output messages are written to <dom3>/dom3backup.log
-r, --restore restore files form backup-dir. Use only from the command line
-t TURN, --turn=TURN assume turn <n>. Only useful with -r. Use from
commandline only
--nocopy don't copy files to backup-dir. Default: False
*Putting it all together*
Assuming windows...
Ex.1) dom3.exe --scoredump --preexec "<Dom3 path>\dom3backup.py -q"
once you hit 'e', your files are copied to <Dom3 path>\savedgames\<gamename>.backup
Ex.2) dom3.exe --scoredump --preexec "<Dom3 path>\dom3backup.py -q -f 1"
same as above, but every turn a zip file is created in <Dom3 path>/archivedgames
The zip-file is named <game-name>-Turn<turnnumber>.zip
Ex.3) dom3.exe --scoredump --preexec "<Dom3 path>\dom3backup.py -q -f 4"
same as above, but zip files are only created on Turn1, Turn 5, Turn9 etc.
Ex.4) dom3.exe --scoredump --preexec "<Dom3 path>\dom3backup.py -q -f 4 -m 2"
same as above, but only 2 zip-files are kept at any time. So if <name>-Turn9.zip is created, <name>-Turn1.zip is deleted
Ex.5) dom3.exe --scoredump --preexec "<Dom3 path>\dom3backup.py -q -b ../saved/#name"
your files are copied to '<dom3>/saved/<gamename>. Of course you're free to also create
zip files, see above
Ex.6) dom3.exe --scoredump --preexec "<Dom3 path>\dom3backup.py -q -b ../saved/#name/#turn"
copied to <dom3>/saved/<gamename>/1,<dom3>/saved/<gamename>/2 etc
Restoring backups:
If you don't used -b, the *last* turn from <Dom3 path>\savedgames\<gamename>.backup is
restored.
Same as above, if you used -b *and* no #turn substitution
If you used #turn substitution, you *must* use the -t argument
So start a shell and:
Ex.1) python dom3backup.py -r
= restore last turn
Ex.5) python dom3backup.py -r -b ../saved/#name
same as above
Ex.6) now you must pass a turn number
python dom3backup.py -r -b ../saved/#name/#turn --turn 1
start from scratch
*Caveats*
Windows: you must use -q
Windows: use / in pathnames, not \
All: if you mess around with the savedgames directory, the auto-detection might no longer work.
Files containing a '.' and newlords are ignored, but if you copy the 'MyFavoritePorns' folder
to savedgames, your pbem-partner might be up for a surprise 
GPL applies......
Comments to ZarahNeander at t-online dot de
04/11/06 Pia Kraft