Easy automatic nightly backups in MBBS/WG DOS
Posted: Thu Jun 18, 2009 12:56 am
I've been working on this pretty much all day, trying to get certain variables to work with my DOS 5 system so that a batch file could be made for daily backups, but I couldn't get anything to work. I got the variables to work but didn't know how to convert them, despite using a few batch files/variables from the web that were suppose to do it (maybe for dos 6 or win nt?)
Why did I need variables? The date format on my copy of DOS is DD-MM-YYYY, which ends up being over the 8 character DOS filename format.
I eventually found a program called XSET, which is considered shareware but is suppose to be uncrippled and it will actually change the date format very easily, with the "XSET datevar DATE" command. After you use this command in a batch file, you can also use the variable in a batch file like this:
xcopy . d:\backups\%datevar%\
When that batch file is called from MBBS/WG's nightly cleanup routine, it will automatically name the directory the date on which the backup is made. Why is this important? It allows you to backup copies for for an extending period of time with no user intervention. You don't have to replace tapes, zip disks, etc every day. Of course, if you don't want a daily backup, it may not be something you'd like!
How to access wg/mbbs's dos batch program... Strange that there's no wgsclean.mdf file in the directory when you install it (at least not in the mbbs 6.26 or wg 1.1 I have) - so, guess what? You have to make it.
The wgsclean.mdf file:
; WGSCLEAN.MDF
Module Name: Offline Cleanup & Events
UNCONDITIONAL
INTERNAL
; Add "Cleanup:" or "Event-X:" lines specifying applications to run, and
; the applications will be executed in that order, during cleanup or the
; specified event.
Cleanup: \TAPE\TAPEBACK.EXE \Program Files\Galacticomm\Worldgroup Server /L- /D+ /SNU
Cleanup: WGSCLEAN.BAT
Event-1: COPY *.DAT \BACKUP
Event-1: WGSEVT1.BAT
Event-2: WGSEVT2.BAT
Event-3: WGSEVT3.BAT
Event-4: WGSEVT4.BAT
This isn't my file. I actually stumbled across it on another site, which made me try to make my own. My copy actually looks a bit more like this:
; WGSCLEAN.MDF
Module Name: Offline Cleanup
UNCONDITIONAL
INTERNAL
Cleanup: WGSCLEAN.BAT
Now, I don't know what the UNCONDITIONAL or INTERNAL things are, if they even need to be there, but I copied them into my file just to be sure.
Now, you have to make a wgsclean.bat file, to call up other batch files. Since I'm only doing one task: backing up the bbs, I only needed one entry: backit.bat
My backit.bat looks like this:
xset datevar date
xcopy . d:\backup\%datevar%\
Make sure to put the slash behind the %datevar% of the program will ask you whether or not it's a file or a directory it's being copied to.
When it's done, it copies to DD-MM-YY format, which is 8 characters as opposed to 10.
This will minimize backup downtime, and you'll have a backup for each day, which may be important if something went wrong in one or more of the files and it went unnoticed for several days. You don't have to settle with just the last backup but could go back for as long as you wanted.
To find xset, just google it.. it should be the first page that comes up.
Why did I need variables? The date format on my copy of DOS is DD-MM-YYYY, which ends up being over the 8 character DOS filename format.
I eventually found a program called XSET, which is considered shareware but is suppose to be uncrippled and it will actually change the date format very easily, with the "XSET datevar DATE" command. After you use this command in a batch file, you can also use the variable in a batch file like this:
xcopy . d:\backups\%datevar%\
When that batch file is called from MBBS/WG's nightly cleanup routine, it will automatically name the directory the date on which the backup is made. Why is this important? It allows you to backup copies for for an extending period of time with no user intervention. You don't have to replace tapes, zip disks, etc every day. Of course, if you don't want a daily backup, it may not be something you'd like!
How to access wg/mbbs's dos batch program... Strange that there's no wgsclean.mdf file in the directory when you install it (at least not in the mbbs 6.26 or wg 1.1 I have) - so, guess what? You have to make it.
The wgsclean.mdf file:
; WGSCLEAN.MDF
Module Name: Offline Cleanup & Events
UNCONDITIONAL
INTERNAL
; Add "Cleanup:" or "Event-X:" lines specifying applications to run, and
; the applications will be executed in that order, during cleanup or the
; specified event.
Cleanup: \TAPE\TAPEBACK.EXE \Program Files\Galacticomm\Worldgroup Server /L- /D+ /SNU
Cleanup: WGSCLEAN.BAT
Event-1: COPY *.DAT \BACKUP
Event-1: WGSEVT1.BAT
Event-2: WGSEVT2.BAT
Event-3: WGSEVT3.BAT
Event-4: WGSEVT4.BAT
This isn't my file. I actually stumbled across it on another site, which made me try to make my own. My copy actually looks a bit more like this:
; WGSCLEAN.MDF
Module Name: Offline Cleanup
UNCONDITIONAL
INTERNAL
Cleanup: WGSCLEAN.BAT
Now, I don't know what the UNCONDITIONAL or INTERNAL things are, if they even need to be there, but I copied them into my file just to be sure.
Now, you have to make a wgsclean.bat file, to call up other batch files. Since I'm only doing one task: backing up the bbs, I only needed one entry: backit.bat
My backit.bat looks like this:
xset datevar date
xcopy . d:\backup\%datevar%\
Make sure to put the slash behind the %datevar% of the program will ask you whether or not it's a file or a directory it's being copied to.
When it's done, it copies to DD-MM-YY format, which is 8 characters as opposed to 10.
This will minimize backup downtime, and you'll have a backup for each day, which may be important if something went wrong in one or more of the files and it went unnoticed for several days. You don't have to settle with just the last backup but could go back for as long as you wanted.
To find xset, just google it.. it should be the first page that comes up.