Q: To keep track of customer details, I use a Microsoft Access database, which has grown to about 8.9MB. I wrote a batch file that uses Robocopy to run daily backups of the database, which is on the D drive of a domain controller (DC) running Windows Server 2003. The backups are stored on a NAS device.
The batch file uses some code (weekday.com) I found on the Web to return a day of the week. As Listing 1 shows, after the batch file finds the day of the week, it uses a series of If commands to jump to code that executes Robocopy and copies the backup file to a folder named after the day of the week. The batch file then uses another script (AnalyzeRobocopyLog.vbs) I found on the Web to go through the log files generated by Robocopy and return a consolidated version. Finally, the batch file uses the Blat utility to email the backup log file to the appropriate person.
This batch file is working okay, but it's a kludge. I want to go with a different approach. I'd like the new script to rename the backup file so that it includes the current date and do away with the weekday folders. That way, there is only one backup folder. I'd also like the script to monitor the amount of free space in the backup folder and overwrite the oldest file if the size of the backup folder is at the specified size limit. I'm trying to write this new script, but I'm just learning the art of scripting. I'm interested in seeing how a scripting pro would approach writing this script.
—Emile Mercier . . .

