Jump to content

backup .bat error checking


Recommended Posts

At work, part of my job is to run some .bat files that do backups on various user computers, network drives, and servers. What I'm trying to do is figure out a way that I can do simpler error checking than my current method (manually check that the source and destination have the same number of files, sub folders, and space). I was thinking of doing this with MD5 sums, but that isn't really feasible seeing as this is a weekly backup of hundreds of thousands of files so the time to generate hashes would be far too long. Does anyone know of a good way to automate this error checking? Thanks.

Link to comment
Share on other sites

At work, part of my job is to run some .bat files that do backups on various user computers, network drives, and servers. What I'm trying to do is figure out a way that I can do simpler error checking than my current method (manually check that the source and destination have the same number of files, sub folders, and space). I was thinking of doing this with MD5 sums, but that isn't really feasible seeing as this is a weekly backup of hundreds of thousands of files so the time to generate hashes would be far too long. Does anyone know of a good way to automate this error checking? Thanks.

I was doing some more research and came across the command comp to compare two files or sets of files. it seems to do exactly what I want it to, but I want to figure out some way to get the output to be very generic like a 1 indicates success and 0 indicates some sort of difference was found. that way if I export the output to a text file, someone can just search the text file for whatever that output is and if 0 shows up they know an error occurred. Any ideas on this matter?

Link to comment
Share on other sites

  • 3 weeks later...

thanks for the replies. sorry it took so long for me to get back. My boss wants to stick with the .bat files we use. I don't really have the option of using professional backup software. At least not at the moment. What I'm curious about now is how I would write up the script that will run comp on the source and backup after the backup is complete and then output to a text file. I'm a little rusty on batch files...

Link to comment
Share on other sites

thanks for the replies. sorry it took so long for me to get back. My boss wants to stick with the .bat files we use. I don't really have the option of using professional backup software. At least not at the moment. What I'm curious about now is how I would write up the script that will run comp on the source and backup after the backup is complete and then output to a text file. I'm a little rusty on batch files...

You can output to text file by doing the following, for example:

dir > text.txt

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy