Automatic Cmud/Zmud settings backup

LaniraLanira Member Posts: 71 ✭✭✭
edited February 2013 in Tech Talk
I figured people might find this useful still. On a related note, is there still a way to use [code] tags on the new forums?

Due to issues with zmud/cmud, it's always a good idea to backup your .mud files. Here's a .bat file I wrote to launch zmud with which backups all your .mud files to a specified folder organized by date and time. Simply change 'zbak' to where you want your backups to be saved and 'zdir' to where you have zmud installed. To save this, open up notepad, copy/paste this code, and save with a .bat extension. After that you can use it to launch zmud.


Zmud:
@echo off
:: variables
set backupcmd=xcopy /s /c /d /h /i /r /y
set hour=%time:~0,2%
if "%hour:~0,1%"==" " set hour=0%time:~1,1%
set folder=%date:~10,4%_%date:~4,2%_%date:~7,2%_%hour%_%time:~3,2%
set zbak=C:\ZBAK
set zdir=C:\Program Files\zMUD

:: backup
echo ### Backing up Zmud mud files...
%backupcmd% "%zdir%\*.mud" "%zbak%\%folder%\"
echo Backup Complete! Starting zmud!
start "" "%zdir%\Zmud.exe"

This one is for CMUD, with an extra variable that points to your package directory. 'cpaks' should be set to where cmud stores your session folders, either in 'program files\cmud' or 'documents\my games\cmud'. Here's the script:

@echo off
:: variables
set backupcmd=xcopy /s /c /d /h /i /r /y
set hour=%time:~0,2%
if "%hour:~0,1%"==" " set hour=0%time:~1,1%
set folder=%date:~10,4%_%date:~4,2%_%date:~7,2%_%hour%_%time:~3,2%
set cbak=C:\CBAK
set cdir=C:\Program Files\CMUD
set cpaks=C:\Program Files\CMUD

:: backup
echo ### Backing up Cmud mud files...
%backupcmd% "%cpaks%\*.pkg" "%cbak%\%folder%\"
echo Backup Complete! Starting cmud!
start "" "%cdir%\cMUD.exe"

You can apply this to anything you want; It's very useful.
Sign In or Register to comment.