Announcement

Collapse
No announcement yet.

Script that runs fine on windows produces NO output in Linux

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

  • Script that runs fine on windows produces NO output in Linux

    I have a script/session that I worked on in my windows BC4, but when I export the sessions from WIndows and import on Linux, the report "runs" but nothing gets produced in the output.

    Here is the script:
    # Script to log the results to a file, and compare the FILES in two folders, and generate a diff-only report.

    #Calling command line:
    # bcompare @"...........FolderCompareBCScript.txt" "My Session" "NOW folder" "SRC folder"
    # Log to a file of the form "..........\My Log 2012-12-31.txt".
    # The exact format depends on your regional and language settings.

    log verbose append:".................................\My Log %date%.txt"

    #Load the Session
    #load "%1"
    # Compare the text contents of the files.
    criteria rules-based

    # Only compare Informatica XML files
    filter "*.xml"

    #Load the now and src directories
    load "%2" "%3"

    #to compare ALL files in the folders add expand all, select all.files and do a file-report
    expand all
    select all.files

    text-report layout:interleaved options:ignore-unimportant,display-mismatches &
    output-to:".....................\testreport.html" output-options:html-color

    #text-report layout:side-by-side options:ignore-unimportant,display-mismatches &
    #output-to:"....................\testreport.html" output-options:html-

    Note the ......... are just to block out the actual paths.

    I get actual file-by-file delta reports if I run this on Windows, but just the base report title stuff in Linux.
    Nothing in the logs.
    ANy ideas???

  • #2
    Hello,

    Is the log generated? It looks like the above sample has the paths edited, but it looks like the paths are using the incorrect path /. Also, I notice the script loads a saved session with %1, but then is commented out. Are you passing in 3 parameters but only using the last two for folder paths? Could you post or email the full script as an attachment and also the command line you are using to execute it? If emailing at support@scootersoftware.com, please also include a link back to this forum thread for our reference.
    Aaron P Scooter Software

    Comment


    • #3
      I uncommented the load of the session, and that also doesn't work.
      Here is the command line I use to run the script:
      bcompare @"/home/gartnerj/cdc/util/FolderCompareBCScript.txt" "CDC Folder Compare" /home/gartnerj/cdc/OPEX/now/ /home/gartnerj/cdc/OPEX/src &
      Attached Files

      Comment


      • #4
        here is the log
        Attached Files

        Comment


        • #5
          So I went and deleted out the sessions, and recreated on the LINUX version. Now in the script, it gets to the " criteria rules-based" step in the script and just sits there. No errors in the ERROR tab, nothing in the log file -- just has the script lines:
          *** Beyond Compare 4 Evaluation -- 26 days remaining ***
          02/21/2019 10:18:07 AM >> # Script to log the results to a file, and compare the FILES in two folders, and generate a diff-onl
          y report.
          02/21/2019 10:18:07 AM >>
          02/21/2019 10:18:07 AM >> #Calling command line:
          02/21/2019 10:18:07 AM >> # bcomp.com @"....FolderCompareBCScript.txt" "My Session" "NOW folder" "SRC folder"
          02/21/2019 10:18:07 AM >> # Log to a file of the form "C:\My Log 2012-12-31.txt".
          02/21/2019 10:18:07 AM >> # The exact format depends on your regional and language settings.
          02/21/2019 10:18:07 AM >>
          02/21/2019 10:18:07 AM >> #Setup LOG
          02/21/2019 10:18:08 AM >> log verbose append:"/home/gartnerj/cdc/OPEX/log/OPEX.InformaticaDiff.Log.2019-02-21.txt"
          02/21/2019 10:18:08 AM >>
          02/21/2019 10:18:08 AM >> #Load the Session
          02/21/2019 10:18:08 AM >> load "CDCInformaticaDiffs"
          02/21/2019 10:18:10 AM Load comparison: /home/gartnerj/cdc/OPEX/now <-> /home/gartnerj/cdc/OPEX/src
          02/21/2019 10:18:10 AM >> # Compare the text contents of the files.
          02/21/2019 10:18:10 AM >> criteria rules-based

          How do I go about debugging this to see what is happening in the "criteria rules-based" line>?

          Comment


          • #6
            When you switch to criteria rules-based, the loaded folders/session will then run a rules-based compare, which can take a long time based on how many files or how large the files are.

            You could test this graphically and watch the progress in the graphical interface, Folder Compare, and in the Session menu -> Session Settings, Comparison tab, enable Rules-based compare, and the folder colors will update as the scan runs.

            Also, loading the session will use any saved session settings, so if the session is already configured to use a rules-based compare you do not need to use the criteria command.
            Aaron P Scooter Software

            Comment


            • #7
              Thanks Aaron -- I will try that, but I let the script run for over a 1/2 hour -- in WINDOWS I had the exact same set of documents to compare and it was done in 30-45 seconds.

              Comment


              • #8
                OK, I updated text compare session (update session defaults) to setup the grammar I want to ignore, and simplified the script and I STILL am getting no delta information in the output file. I have attached the script, the log, and the output file.
                Here is the command line:
                bcompare @"/home/gartnerj/cdc/util/FolderCompareBCScript.txt" /home/gartnerj/cdc/OPEX/now/ /home/gartnerj/cdc/OPEX/src &
                Attached Files

                Comment


                • #9
                  This SAME script/cmd line runs correctly in Windows (with appropriate path changes). One additional item. My WINDOWS version of BC is Version 4.1.5 (build 21031). My linux version is: Version 4.2.9 (build 23626)

                  Note the INTERACTIVE diff for the file shows the deltas correctly -- just the scripted report does not.
                  Attached Files

                  Comment


                  • #10
                    Hello,

                    The filter in the script is set to "*.xml", which would filter out subfolders without that name, but leave every file of every time in the base folders. If there are many non-xml files, or if any of them are particularly large, they would be selected and their content would be included in the script. This looks like it could lead to unintended results.

                    Does your Windows script run access the same folders located on the Linux machine, via a remote connection? Given how the selection is accessing every file in the base folder, it seems likely a difference in the files selected would have a large impact on the comparison, more than the differences between the Beyond Compare installations.

                    To better test the effects of script, I would suggest instead using the graphical interface on the same Linux machine, where you can load the folder compare and paste in the two folder paths, and apply the filter by pasting it into the Filters toolbar (without quotes), and hit enter to apply. Then issue the same sequence of commands: select all, then Actions menu -> File Compare Report.
                    Aaron P Scooter Software

                    Comment


                    • #11
                      TY Aaron. The files in the folders are ALL .xml files, and always will be. These folders will both be refreshed every time BEFORE this runs, so I want the comparison to be on all of the files in the folders.
                      In additon, the files were in the WINDOWS system, and I just sftp'd the exact files from WINDOWS to the directory on linux, so there are no differences between the actual files.


                      I did use the GUI on linux to run the deltas for a file, and they DO show the same as it does in the GUI for windows. It just seems the script doesn't result in any actual output. I will try doing the filter and actions menu...

                      Comment


                      • #12
                        I removed the filter completely from the script and still nothing in the output.

                        Comment


                        • #13
                          Hello,

                          I've tried running the script on small sample folders, and it is working ok. If you create a couple small test folders on your Desktop, and use those as targets for your script, does this work?

                          If you are still having trouble, please include the most recent script.txt attachment, so I can double check the more recent changes.
                          Aaron P Scooter Software

                          Comment


                          • #14
                            I don't have a desktop on the Linux machine -- I am just ssh'd into that. The intent is to run a script that we can automate getting the diffs for Informatica XML files. Attached is the latest script.

                            I am running the file comparison report on the linux GUI, but the performance is awful. Something that runs on my windows box in about 1.5 minutes has been running for WELL over a 1/2 hour now and hasn't produced the report yet.
                            Attached Files

                            Comment


                            • #15
                              BC4 requires an X-Windows environment in order to run in both graphical and scripting modes. You mention that you don't have a Desktop, but then also that you were able to test the Linux GUI. Are you able to launch BC4's interface on the same machine running the script on the same data set?

                              It sounds like there is a problem file in your data set. Please try creating a pair of test folders with a handful of test files on your Desktop, then test against this dataset first to get the interface and script working. Once this is working, we can then go back to your real folders and narrow down which files or folders might be causing this slow down.
                              Aaron P Scooter Software

                              Comment

                              Working...
                              X