|
GeneralStonewall Magician
Joined: 02 Feb 2004 Posts: 364 Location: USA
|
Posted: Thu Dec 03, 2009 4:41 am
[BAT Script] Automatic backups (Never lose your settings again!) |
Here's a batch script I wrote that will make backups of all your package files and sort them, into a separate directory, by date and time. While Cmud does have an option for backups, sometimes those get overwritten before you notice that you've messed up something really bad or maybe you just want to look at your work from several months ago. After it finishes backing up all your package files it will close itself and launch Cmud.
To save this, open up notepad, copy/paste this code, and save with a .bat extension. 'cdir' is the directory where you have cmud installed, 'cpaks' is where you have your package folders, and 'cbak' is where it will save the backups.
Code: |
@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 (x86)\CMUD
set cpaks=C:\Program Files (x86)\CMUD
:: backup
echo ### Backing up Cmud mud files...
%backupcmd% "%cpaks%\*.pkg" "%cbak%\%folder%\"
echo Backup Complete! Starting cmud!
start "" "%cdir%\cMUD.exe" |
Here's the zmud version:
http://forums.zuggsoft.com/forums/viewtopic.php?t=34350
Here's what it does:
|
|
Last edited by GeneralStonewall on Tue Apr 27, 2010 2:26 am; edited 5 times in total |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Thu Dec 03, 2009 1:34 pm |
You should know that the new version being beta tested includes the option of keeping a user-specified number of backups. That might make this script less necessary. But your script is a clever solution.
|
|
|
|
DanteX Apprentice
Joined: 13 Aug 2007 Posts: 166
|
Posted: Thu Dec 03, 2009 2:03 pm |
I guess that the script (with a bit of modification) is appliable to zMUD files also, which makes it handy.
|
|
|
|
GeneralStonewall Magician
Joined: 02 Feb 2004 Posts: 364 Location: USA
|
Posted: Thu Dec 03, 2009 9:00 pm |
Rahab wrote: |
You should know that the new version being beta tested includes the option of keeping a user-specified number of backups. That might make this script less necessary. But your script is a clever solution. |
Right, but this script will never overwrite old backups. I actually use the beta version; I just felt that I needed something more organized and full-proof.
DanteX wrote: |
I guess that the script (with a bit of modification) is appliable to zMUD files also, which makes it handy. |
Here's a version for zmud: http://forums.zuggsoft.com/forums/viewtopic.php?t=34350 |
|
|
|
adamandkate Wanderer
Joined: 14 Oct 2009 Posts: 57
|
Posted: Fri Dec 04, 2009 1:11 am coool |
i really quite like this. every time i mage a change at the end of the day i save my backups as the date eg 041209.pkg. this will save me a hastle
thanks |
|
|
|
|
|