binary comp only if date<> / >= 2 servers?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    binary comp only if date<> / >= 2 servers?

    Hello,
    currently testing tools for COMPARING (not synchronizing) servers. I need to do the following:
    a) make sure NO FILE OPERATIONS other than reading is done
    (I'm using read-only share for that purpose)

    b)
    compare directory trees:
    IF
    file by same name exist in both trees
    in same location,
    THEN
    BEGIN
    IF size differs
    THEN show as different files
    ELSE
    BEGIN
    IF date differs THEN
    BEGIN
    automatically start background binary check
    and as soon as a difference is found, show files
    as different
    END
    END
    END
    ELSE
    BEGIN
    show any mismatches files/directories
    which are found on one side only (source or target)
    END

    Once this works for two servers, I would have to apply
    that comparing multiple servers...
    If that is not possible,
    it would help if I could reuse all exlusion features
    (at there are many files in certain directories, like
    exclude all *.log in \\srv\share\dir1\dir2\, which need
    to be excluded - i.e. if possible use a common exlusion list, regardless of which 2 servers are being compared, so that I can apply any new to-exclude-findings ).

    CAN IT BE DONE ?-)

    (so far I use "robocopy /MIR /L" from Microsoft, but
    this does not have an option to binary compare)

    TIA
  • Zoë
    Team Scooter
    • Oct 2007
    • 2666

    #2
    Re: binary comp only if date<> / >= 2 servers?

    Do you need this to be an interactive comparison?

    We don't have anything as simple as Robocopy, but it sounds like you'd want to use our scripting support. That will work, but you'll only be able to get the results as a folder comparison report; it won't display them as it goes the way Robocopy does.

    Assuming that's ok, yes, BC will handle it. You'll need to read through the "Script Processing" section of the Help file, but here's a sample to get you started:

    Code:
    # Set up basic comparison features
    criteria size timestamp:2sec
    filter "-\dir1\dir2\*.log"
    
    # load first comparison
    load \\srv1\share \\srv2\share
    
    # compare files with timestamp differences
    select newer.files older.files
    compare binary
    
    # generate a report of the differences
    folder-report layout:summary options:display-mismatches output-to:C:\report.txt
    That will perform the comparison like you described. The select command does select files that have different sizes, but the binary comparison will automatically skip them.

    When using scripts file operations have to be explicity added, using the copy, delete, sync, etc commands, so it's effectively read-only.


    There are a couple of ways to run this across multiple comparisons:<ul type="square">[*]Include everything from the load command to the bottom multiple times in the script. Scripts are executed sequentially, so that will set the criteria and filters once, then perform the comparisons as it encounters them.[*]Use command line variables and call the script multiple times. You can use %1 through %9 to reference command line variables. So you could just replace the load line with: load %1 %2 and then call BC multiple times like this:

    Code:
    C:\BC2.exe @script.txt \\srv1\share \\srv2\share
    C:\BC2.exe @script.txt \\srv1\share \\srv3\share
    etc...
    [/list]
    Zoë P Scooter Software

    Comment

    • Guest's Avatar

      #3
      Re: binary comp only if date<> / >= 2 servers?

      wow, thanks for your swift<!> response.

      sounds fair enough.

      I've tried your GUI, and things went so far alright.
      GUI would be nice for this, but then again multiple servers might not fit the screen. I kept changing the server name and then use F5 - worked alright.

      I'll try the scripting tomorrow. Merely listing would be fine.

      Meanwhile I've added a considerable number of exlusions in the GUI. I have saved the session and reopened it alright in the GUI. Is there a way I can copy&paste the exclusions from the GUI to the script?

      Or simpler, is there a way I can save the session to a "ready-to-go" script?-)

      TIA

      Else, if you don't mind: how do I add multiple filters?

      Comment

      • Guest's Avatar

        #4
        Re: binary comp only if date<> / >= 2 servers?

        whoa, sorry forgot,

        I'm trying to achieve s.th rather simple:
        keep multiple servers equal -

        1st off, by merely comparing them
        (never change a running system)

        =>

        Robocopy /MIR /L
        sounds fine, but unfortunately for some reason file dates
        may differ, but the files are in fact equal.
        So I get thousands of files listed, wrongly, as they are equal.

        Another point is, that the servers are "online", so I will
        always have a large number of temporary files, which
        also mess up the robocopy listing.

        your exlusion feature eg. all ".log" and "in this directory only" is very good for the ladder!-)

        The "compare in viewer" is also fantastic(!) as some batch-files and the like differ by size/date/time but are in fact equal by content, so to speak.

        The only Problem I still have, is how to automate all this and also to run it over more than two servers
        ->
        so that finally I can quickly get an overview about which files really differ, and should be examined.

        If scripting won't do the GUI is not too bad, esp. since I can run binary checks over entries directories/trees and equal files dissappear from the selected view automatically then.

        I'm just curious the binary compare is so much faster than the Windows fc.exe /B compare, that is hard to believe, that it compares byte by byte :-)

        thanks again

        Comment

        • Zoë
          Team Scooter
          • Oct 2007
          • 2666

          #5
          Re: binary comp only if date<> / >= 2 servers?

          The fastest way to do this in the GUI would be to set the comparison criteria to size and timestamp checks (the default), then change the display filter to "Just Mismatches", followed by "Select All Files", then "Compare Contents".

          What you were doing for multiple servers is the only thing that we support right now. If you just type in the new server and press [Enter] it should load the new comparison without requiring an explicit F5 refresh.

          To get the filters from the GUI you can just copy the filter form the "Filters" dropdown. The format for scripting is the same. If you set BC up with the "Simple" interface type the filter bar won't be visible. Just right click on the toolbars and check the "Filters" menu item.

          We don't have a way to export sessions to scripts yet, but you can load a session, including it's filters, in the script. Just use the format load <session name>. You could then load just folders from then on and it will continue using the filters.

          In scripting new filter commands always override the old ones, but you can make the filters span across multiple lines using the line continuation character (&). Eg:
          Code:
          filter .\folder1\subfolder1 &
          .\folder2\ &
          .\folder3\subfolder2
          Depending on how the batch files are formatted, you might have some luck with a rules-based comparison instead of a binary one. That parses the files and performs an intelligent comparison, so you can ignore comments, whitespace, etc.

          As for speed, it looks like that just shows how slow FC.exe is for this kind of thing. When I ran it here it started outputting all of the byte locations that differed, meaning it was completely comparing the files. BC does do a full byte-by-byte comparison, but it stops as soon as the first difference is found.
          Zoë P Scooter Software

          Comment

          Working...