EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Database/World Building (https://www.eqemulator.org/forums/forumdisplay.php?f=596)
-   -   Updated Bot Backup Batch File (https://www.eqemulator.org/forums/showthread.php?t=28214)

nosfentora 05-14-2009 03:02 PM

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



All times are GMT -4. The time now is 01:20 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.