View Single Post
  #1  
Old 05-14-2009, 03:02 PM
nosfentora
Discordant
 
Join Date: Oct 2004
Location: In a house
Posts: 387
Default Updated Bot Backup Batch File

Here's an updated .bat file to save *all* the bot info when doing a backup

Code:
@echo off
cls
REM Change these variables to suit your setup

REM the name of your database
set db=peq

REM the ip of your MySQL server, leave as is if local
REM -h prefix is needed if remote
set ip=-h127.0.0.1

REM Your database password, leave blank to enter manually
set pass=changeme

REM the folder to backup to (created in the current folder), set to . to not create a folder
set backupdir=bot_backup
REM the name of the bot backup file to create
set backupfile=bot_npcs.sql

echo **************************************
echo ***        Backing up Bots         ***
echo **************************************
if backupdir==. goto :end
dir .\ /a:d | find /i "%backupdir%" > nul
if errorlevel 1 goto notfound
goto :end
:notfound
md %backupdir%
:end
echo *** Dumping Bots from NPC_Types... ***
mysqldump -u root -p%pass% %ip% "--where=id in (select botnpctypeid from botsowners)" -x -t %db% npc_types > %backupdir%\%backupfile%
echo *** Dumping Bot Groups...          ***
mysqldump -u root -p%pass% %ip% -x -t %db% botgroups >> %backupdir%\%backupfile%
echo *** Dumping Bot Inventory...       ***
mysqldump -u root -p%pass% %ip% -x -t %db% botinventory >> %backupdir%\%backupfile%
echo *** Dumping Bot Leader...          ***
mysqldump -u root -p%pass% %ip% -x -t %db% botleader >> %backupdir%\%backupfile%
echo *** Dumping Bots Owners...         ***
mysqldump -u root -p%pass% %ip% -x -t %db% botsowners >> %backupdir%\%backupfile%
echo ***          Done dumping!         ***
echo **************************************
echo To re-source the bots source '%backupdir%\%backupfile%'
pause
Reply With Quote