Announcement

Collapse
No announcement yet.

Making two hard drives identical.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Making two hard drives identical.

    Hello. I am wondering if Beyond Compare is the software I've been looking for.

    What I want to do is pretty simple. The only thing is, I want to be able to do it with the click of a button without having to enter any settings each time. (A simple set it and forget it type of thing if you know what I mean)

    All I need to do is make D:\ and E:\ 100% identical.

    I do all my work on D:\ and I want to be able to make an identical backup copy onto E:\ by simply executing a batch file that will take care of it for me.

    Is this possible with Beyond Compare? If so, how can I accomplish this task?

    Thanks for the help,

    -Ricky

  • #2
    Re: Making two hard drives identical.

    So I did a little research and I think I've figured it out.

    Here is the script that I'm using:

    Code:
    log verbose
    load "D:\" "E:\"
    sync create-empty mirror:lt->rt
    So would this be the correct way to do it? I just want to make sure with you guys first.

    Also, if I decide to compare with CRC then my script would look like this:

    Code:
    log verbose
    criteria crc
    load "D:\" "E:\"
    sync create-empty mirror:lt->rt
    While the other way would only compare via file size right?

    Is there anything I need to add to the script that I am forgetting? Or anything useful you would recommend I add?

    Also, is there a way to make it do a CRC comparison for all files except *.zip files? (I'd rather the zip files be compared via file size only).

    Thanks in advance. I now see this is a really powerful software!

    Comment


    • #3
      Re: Making two hard drives identical.

      Hi Ricky!

      So far your script looks o.k.

      I would give the following hints:

      log verbose: You can specify a path & filename for the logfile. Else it will always be written as Log.txt in your system-folder.

      criteria crc: The different options of this command have a huge impact on the comparison speed. Using crc or binary makes BC read all files which are present on both source and destination folder, which can take a lot of time depending on the amount of data you want to compare at all.
      But you can be sure, that different files are definitly detected.

      When you use "timestamp" and "size" file modifications should get detected, too. This is a very fast method but probably not 100% save in some rare circumstances.
      Personally I'm using "binary" as default.

      Furthermore I recommend to create a session in the BC GUI for your synchronizing task. Then try to fullfill the task in the GUI by selecting the corresponding commands. Doing so you can proof that all neccesary settings are set and use that session in the script by calling it with the "load" command.

      Excluding *.zip: In the current version of BC the "criteria" command is a global one. It is not possible to set different criterias for different file types.

      But there may be a work-around: You could split the sync task in two separate sections or better two scripts.
      The first one uses crc or binary but uses a filter to exclude *.zip files.

      The second one uses timestamp and size an a filter to only include *.zip files.




      Bye
      Christoph

      Comment


      • #4
        Re: Making two hard drives identical.

        Hi chrroe and thanks so much for the ideas and suggestions!

        Furthermore I recommend to create a session in the BC GUI for your synchronizing task. Then try to fullfill the task in the GUI by selecting the corresponding commands. Doing so you can proof that all neccesary settings are set and use that session in the script by calling it with the "load" command.
        ^This one I didn't quite understand. Am I supposed to use the load command in the script or is it optional? At the very basic, I just need the script to make sure E:\ is always identical to D:\. The whole CRC and excluding zip files are just things that I would possibly like to do but they are not necessary. The most important thing is for me to make sure my 2 hard drive are 100% identical.

        I don't want to have to mess around with the GUI or any options or settings because I don't really understand everything too well. All I want is to have this script with all the settings already inside it so that I can launch it whenever I need to update my backup drive with the latest changes.

        Comment


        • #5
          Re: Making two hard drives identical.

          The reason to try it out in the GUI first is our scripting language basically mirrors what you can do in the GUI. It is just a way of 'programming' it so a batch file can call it and perform the actions in sequential order.

          By getting the operation to happen in the GUI, you'll know the steps you want to do. Then it is just a matter of finding each of those steps' script.

          So, for example, you have a saved session that contains your filters and other stuff you like to use when using the GUI, you'd need to call and load it in script as well.

          While the GUI can be a bit intimidating as first, I would recommend doing your Mirroring task once or twice with it, just to get the hang of it. The button I believe you are looking for is the Sync Right button (top middle, near Sync Left and Custom Sync. Looks like yellow arrows).

          Once you understand the GUI, you'll see the script and understand why things are done in a certain order a bit better, and it will be easier to see why it is working in a certain way. You'll also want to set up a session in the GUI to make the scripting go a little easier (it is a bit easier to load a session with certain settings than it is to define them all in the script individually. some settings have to be loaded from a saved session, anyway).

          Lastly, if you don't need this to be a scheduled task (scheduled every week, for example) you may find that most every setting you need can be saved as a Session in the GUI, and that the only interaction you need to do from the program is 'Load the session' and 'click the sync right arrow'. You may find this easier than writing a script at all.

          If you have any questions, feel free to ask here, or email us at
          support@scootersoftware.com
          Aaron P Scooter Software

          Comment


          • #6
            Re: Making two hard drives identical.

            And thanks for jumping in, and helping out!
            Aaron P Scooter Software

            Comment


            • #7
              Re: Making two hard drives identical.

              Thanks a lot Aaron. Except I think I am a little confused now because in the help file I read that I need to select the "mirror left to right" in order to make my hard drives identical. But you are saying that I should use the "Sync left to right" option. I'm going to test it out now and see how it goes. Hopefully that will clear any confusion.

              Anyways, I understand what you guys are saying when you suggest I should mess around with the GUI first but the thing is, I posted this topic in the scripting section because that is what I am more comfortable with.

              All I can do is tell you in words what I need accomplished and then I hope you guys can help me write a script to do it. Once I have the script written, I'll be able to just run it without any need to go into the GUI or mess with any settings. I just need your help in writing this script as you guys are obviously know a lot more about this than I do.

              In plain words, here is what I need to accomplish:

              Make E:\ exactly identical to D:\ in every way.

              After reading the help file I came up with this script:

              Code:
              log verbose
              load "D:\" "E:\"
              sync create-empty mirror:lt->rt
              Although since I am new to all of this I need your help to confirm that this is indeed all I need in the script in order to accomplish my main goal. I don't know if I may be forgetting anything or if there may be a better way to write this script so that's why I am asking you guys.

              I'd really like to do this with a script and not via the GUI. I discovered Beyond Compare while searching for a commandline synchronization utility and figured I'd give it a try since I saw it had scripting capabilities.

              Thanks again for all the help but please, lets focus on the scripting

              Comment


              • #8
                Re: Making two hard drives identical.

                Ricky,

                The script you listed is the correct way to do this.

                log verbose
                load "D:\" "E:\"
                sync create-empty mirror:lt->rt

                Please note that this will copy your files and preserve their modified dates. Beyond Compare doesn't currently preserve folder timestamps, file creation dates, or file permissions. File permissions behave the same was as a copy using Windows Explorer. If source files are owned by a different user, the copied files will be owned by the currently logged on user.

                You can manually try to preserve folder dates by using another command. This will only work if you have administrative rights and if the target drive is formatted NTFS.

                To copy folder timestamps after the files are synchronized, use this script:

                log verbose
                load "D:\" "E:\"
                sync create-empty mirror:lt->rt
                expand all.folders
                select all
                touch lt->rt
                Chris K Scooter Software

                Comment


                • #9
                  Re: Making two hard drives identical.

                  Thanks Chris,

                  I'm the only user on this particular PC so I don't think I need to worry about file permissions.

                  Regarding the folder timestamps and file creation dates, is there any benefit in preserving that info?

                  Until now, I've been doing my syncing with a simple batch file consisting of two lines of code:

                  del e:\*.* /s
                  xcopy d:\*.* e:\*.* /s

                  It gets the job done but now that I have a lot of files I figured it would be better to look into a software that is specialized in doing this kind of thing. The only thing I care about is being able to run it in the same way I run this old batch file. And BC seems to be able to do what I need.

                  Now regarding this particular script:

                  log verbose
                  load "D:\" "E:\"
                  sync create-empty mirror:lt->rt

                  How is BC comparing the two base folders? For example, is it just by filesize or timestamp or both? Or perhaps something else?

                  And lets say I add the following line:

                  log verbose
                  criteria crc
                  load "D:\" "E:\"
                  sync create-empty mirror:lt->rt

                  Would that make it do the comparing through CRC only?

                  Thanks again everyone for all the replies and taking the time to help me out!

                  Comment


                  • #10
                    Re: Making two hard drives identical.

                    Ricky,

                    Unless you have a specific need for preserving the folder dates, then it probably isn't an issue.

                    If you don't specify comparison criteria, Beyond Compare will use the default criteria. Unless you've changed the default criteria using Session|Set Defaults in an interactive session of Beyond Compare, it will use timestamp and size comparison.

                    If you want to make sure timestamp and size is being used, you can include the command "criteria timestamp size" at the start of your script.

                    Every time you use a criteria command in a script, it replaces the existing criteria. The command "criteria crc" will only compare CRC values.

                    Also, in most cases you'll want to use binary comparison instead of CRC. For an explanation, see: http://www.scootersoftware.com/support.php?c=kb_crc.php
                    Chris K Scooter Software

                    Comment


                    • #11
                      Re: Making two hard drives identical.

                      If you don't specify comparison criteria, Beyond Compare will use the default criteria... ...If you want to make sure timestamp and size is being used, you can include the command "criteria timestamp size" at the start of your script.
                      Thanks Chris! That is very useful info to know and now I am glad I asked this question. I will add "criteria timestamp size" to the start of my script right away.

                      This is because I want all the settings included in the script file (I don't want the script to have to look elsewhere for default settings stored in other parts of the program)

                      So with that being said here is my new script:

                      criteria timestamp size
                      log verbose
                      load "D:\" "E:\"
                      sync create-empty mirror:lt->rt

                      Now is there any other information missing in this script that is being pulled from an external source that I need to know about? Like I said, I just want all the info contained within the script so it will always remain consistent even if I happen to change some default settings within the program one day.

                      Thanks again man, I really appreciate your help!

                      Comment


                      • #12
                        Re: Making two hard drives identical.

                        The script you posted is correct. It shouldn't depend on any external sources. If you have any other questions, please let me know.
                        Chris K Scooter Software

                        Comment


                        • #13
                          Re: Making two hard drives identical.

                          Great! Thanks for your help Chris!

                          And thanks chrroe and Aaron as well!

                          I must say, this is an amazing piece of software!

                          Comment


                          • #14
                            Re: Making two hard drives identical.

                            Hi,

                            I just noticed that there are two hidden system folders in the root of each hard drive called "RECYCLER" and "System Volume Information".

                            I want my BC script to exclude those two folders from the mirroring process. So I added this line of code:

                            filter "-RECYCLER\;-System Volume Information\"

                            I just want to make sure with you guys that this is the correct way to do it and that there aren't any mistakes in this filter I added. That's why I'm asking.

                            Thanks guys

                            -Ricky

                            Comment


                            • #15
                              Re: Making two hard drives identical.

                              Yes, those filters are correct. They will remove folders named "Recycler" or "System Volume Information" at any location from the comparison. If you only want folders with those names directly at the root of the comparison filtered out, use "-.\RECYCLER\;-.\System Volume Information\". The ".\" means relative to the loaded base folders.
                              Chris K Scooter Software

                              Comment

                              Working...
                              X