In my previous Blog posting I talked about the theory in automating a Windows 2003 Server backup. Let's now look at the actual utilities and commands to make this possible. I will run through the command in the actual order I use them in a batch file. I would in fact run through these commands outside of a batch file first to check each command runs successfully on your server. Links to the utilities used can be found at the end of the Blog.
The first utility we need it Devcon. This is Microsoft command line utility that can be used instead of Device Manager. What we are going to do is disable the physical floppy disk device using this utility. Once you have Devcon installed first issue this command which should list any of your devices with the word "floppy" in it –
DEVCON find *floppy*
What this should do is return some sort of floppy disk drive if you have one installed. To disable this device I then use
DEVCON disable *floppy*
If you check Windows Explorer or Device Manager you should now find the floppy disk drive is missing/disabled.
The next utility I use is "Virtual Floppy Drive". Once this is installed I can use the "VFD" command to manipulate the virtual floppy disk drive. First I issue the following two commands –
VFD start
VFD open /force
This starts the virtual floppy and "opens" a blank 3.5" 1.44MB disk into it
Next we start the actual backup. Like I said previously I store the backups on an attached USB device that is shared. This way I already have the backup ready on a removable device. So the command issued here is quite simple –
ntbackup asrbackup /j "ASR" /f \\SERVERHOSTINGTHEUSBDEVICE\ASR$\%computername%\asr.bkf
Just running through the above the "asrbackup" just tells ntbackup that we are running an ASR backup. The /j "ASR" just gives the backup "job" a name which is useful for checking log files. The /f just says we are backing up to a file. Within the file location I add the %computername% so that I get a structure of server names on my USB device.
Once the ASR backup has finished we end up with some key files on the virtual floppy disk. So I then issue a COPY command of the floppy disk files to a subdirectory of the backup called FLOPPY. For reference it's also worth knowing you can retrieve these important files from the backup file itself. If you had to do this you open the backup file in ntbackup and open the second listed drive C. In there you will see a Windows directory and then a repair directory. You can navigate to the files within this directory and restore from there to a floppy disk.
Having copied the files from the floppy I can stop the virtual floppy disk drive. This is done using the following command –
VFD /stop /force
And once the virtual floppy disk has been stopped when can enable the physical floppy disk drive using
DEVCON enable *floppy*
So that's it really. The only additional thing is to schedule the task using the built in Windows scheduler. Just one thing to remember here and it relates to checking the backup log file. To open a log file you can open "ntbackup" and then choose Tools, Report. Just remember that if you create the scheduled task to run under a separate username the logs are stored under that user's profile. And finally this system should work exactly the same way on Windows XP.
The following utilities were used -
The utility can be downloaded from the following location -
http://support.microsoft.com/kb/311272
Virtual Floppy Drive -
http://chitchat.at.infoseek.co.jp/vmware/vfd.html
If you do have any comments or a better way of automating this system please post your comments.
Friday, August 07, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment