Register Modifications Contact Us

Titan Quest


Go Back   Titan Quest Forums > Titan Quest > Technical Corner
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read



If you are having problems logging in, send a mail to webmaster@titanquest.net and we'll try to sort something out.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-16-2008, 01:10 AM
Craig321's Avatar
Craig321
[User Offline]
Warrior
 
Join Date: Jun 2006
Location: UK
Posts: 114
Default Simple effective backup batch script

Just thought I'd share as this script has saved me and my brother a couple of times from losing our characters. This script will create every backup in a separate WinRAR file (compressed), this means you have multiple choices of backups to restore your character from if anything goes wrong

You'll need WinRAR installed.

Put this into a "name.bat" file (start Notepad, paste the code in and name it e.g. TQBackup.bat):
Code:
@echo off

set CURRDATE=%DATE:/=-%
set CURRTIME=%time:~-10,1%-%time:~-8,2%-%time:~-5,2%

set TQPATH=C:\My Documents\My Games\Titan Quest - Immortal Throne\
set WINRAR=C:\Program Files\WinRAR\rar
set DEST=E:\Game Saves\Titan Quest - Immortal Throne

cd /D %TQPATH%
"%WINRAR%" a -r "%DEST%\%CURRDATE%_%CURRTIME%.rar" *.*
You'll just need to change the paths according to your setup.

TQPATH = The path to where your character are stored. So, for example if you're on TQ original change to C:\My Documents\My Games\Titan Quest

WINRAR = This is where your WinRAR is installed. If you use Windows XP this will typically be the same, if on Vista x64 then it'll probably be "C:\Program Files (x86)\WinRAR\rar"

DEST = This is where you want the backups to go. Make sure there is no backslash after this folder address. In my case the backups are going to E:\Game Saves\Titan Quest - Immortal Throne (my external).

If you have changed none of your install/storage locations, and you're on Windows XP the full script posted above should work 'out of the box' providing you change the backup destination.

If you'd like to backup your vault as well (if you use TQVault) use the following script:
Code:
@echo off

set CURRDATE=%DATE:/=-%
set CURRTIME=%time:~-10,1%-%time:~-8,2%-%time:~-5,2%

set TQPATH=C:\My Documents\My Games\Titan Quest - Immortal Throne\
set VAULTPATH=C:\My Documents\My Games\Titan Quest\TQVaultData\
set WINRAR=C:\Program Files (x86)\WinRAR\rar
set DEST=E:\Game Saves\Titan Quest - Immortal Throne

cd /D %TQPATH%
"%WINRAR%" a -r "%DEST%\%CURRDATE%_%CURRTIME%.rar" *.*

cd /D %VAULTPATH%
"%WINRAR%" a -r "%DEST%\VAULT_%CURRDATE%_%CURRTIME%.rar" *.*
The above will backup your Vault into a separate RAR folder.

VAULTPATH = Location of the Vault data, this will usually be the same for everyone.
__________________

Last edited by Craig321 : 06-16-2008 at 01:31 AM.
Reply With Quote
  #2 (permalink)  
Old 06-16-2008, 06:35 AM
Sova
[User Offline]
Warrior
 
Join Date: Jul 2006
Location: Serbia, Belgrade
Posts: 168
Default Re: Simple effective backup batch script

That is just plain awesome!!!
Will try as soon as possible!
__________________
DOS = HIGH???
I knew it was on something!!!
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 03:24 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Titan Quest Forums are not affiliated with THQ/Iron Lore.