sftp as base folder

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • benny
    Visitor
    • Jun 2013
    • 5

    sftp as base folder

    Hi,

    Please explain why I keep getting a Unable to load base folder error when trying to run this script. The file locations are already loaded into the session so I don't understand why I would need to load them again in the script. Of course, I get the same error when I omit the second load comment:

    load "session1"
    load "sftp://[email protected]/file_1.txt" "C:\file2"
    load <default>

    Logfile:

    6/10/2013 5:53:18 PM *** Beyond Compare 3 Evaluation -- 30 days remaining ***
    6/10/2013 5:53:18 PM >> # Turn logging on.
    6/10/2013 5:53:18 PM >> log verbose append:"C:\BeyondComapreLog.txt"
    6/10/2013 5:53:18 PM >>
    6/10/2013 5:53:18 PM >> # Load session
    6/10/2013 5:53:18 PM >> load "session1"
    6/10/2013 5:53:18 PM Load comparison: <->
    6/10/2013 5:53:18 PM Fatal Scripting Error: Unable to load base folder
    6/10/2013 5:53:20 PM Script completed in 1.95 seconds
  • Aaron
    Team Scooter
    • Oct 2007
    • 16002

    #2
    Hello,

    BC3 stores settings per Windows User account in the respective %AppData% directory. Is your test script running as the same Windows User account?

    Loading a session in script is similar to loading it in the graphical interface. The locations, filters, and other session settings are in place and do not need to be reloaded or reapplied.

    I would suggest testing with a basic Command Line prompt. If you are still having trouble with scripting, please try a Portable Install (single directory install) which would use the same settings regardless of which Windows Account is used.
    Aaron P Scooter Software

    Comment

    • benny
      Visitor
      • Jun 2013
      • 5

      #3
      Originally posted by Aaron
      Hello,

      BC3 stores settings per Windows User account in the respective %AppData% directory. Is your test script running as the same Windows User account?

      Loading a session in script is similar to loading it in the graphical interface. The locations, filters, and other session settings are in place and do not need to be reloaded or reapplied.

      I would suggest testing with a basic Command Line prompt. If you are still having trouble with scripting, please try a Portable Install (single directory install) which would use the same settings regardless of which Windows Account is used.
      Hi,

      Thanks. I got past that. Next is this error:

      6/11/2013 12:13:22 PM *** Beyond Compare 3 Evaluation -- 29 days remaining ***
      6/11/2013 12:13:22 PM >> # Turn logging on.
      6/11/2013 12:13:22 PM >> log verbose append:"C:\BeyondComapreLog.txt"
      6/11/2013 12:13:22 PM >>
      6/11/2013 12:13:22 PM >> # Load session
      6/11/2013 12:13:22 PM >> load "session"
      6/11/2013 12:13:22 PM Fatal Scripting Error: Loaded session must be Folder Compare session
      6/11/2013 12:13:25 PM Script completed in 3.64 seconds

      Loading the session does work in command line.

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 16002

        #4
        Hello,

        Scripting only supports loading a Folder Compare session type. We do not support loading other saved sessions in scripting (Folder Sync, Text Compare, etc).

        What type of session are you trying to load, and what actions (generate report? Sync files?) are you attempting to perform? We should be able to help with the script needed if we know more about the actions you want to take.

        A basic sync script would be something similar to:
        load "c:folder1" "sftp://user@ipaddress"
        or
        load "folderCompareSession"
        sync update:left->right

        Please note that there is no Undo command, and no method of previewing before an automated sync is performed. Please test with test data while you are learning script.
        Aaron P Scooter Software

        Comment

        • benny
          Visitor
          • Jun 2013
          • 5

          #5
          purpose of script

          I was hoping to schedule a daily job to automatically compare a local file to a remote ftp file, compare and email a report of important changes to the local file and then overwrite the local file with the remote ftp file.

          Comment

          • Aaron
            Team Scooter
            • Oct 2007
            • 16002

            #6
            Hello,

            Similar to the graphical interface, the steps below would set up a filter to show only the specific file, then load a pair of folders (with only the specific file included), expand all subfolders and select files (which, would be only the specific file). You can then generate a report on the selection, or copy the selection from one side to the other. Since each script step is sequential, you can perform one then the other.

            **BC3 does not support an UNDO command, so please test with a pair of test folders first.**

            I would also suggest stepping through each of these steps in the graphical interface first, to help verify it will behave as expected since the interface allows for previewing and additional feedback.

            Code:
            filter "specificfilename"
            load "c:\folder1" "ftp:\\user@ipaddress\folder2"
            expand all
            select all.files
            text-report layout:side-by-side options:display-mismatches output-to:"c:\bcreport.txt"
            copy left->right
            Load a blank folder compare session, and set the file name filter for only your file.
            Load your pair of folders into the comparison.
            Edit menu -> Expand All
            Edit menu -> Select All Files
            Actions menu -> File Compare Report dialog to generate a report
            Copy command to copy the selection from one side to the other.
            Aaron P Scooter Software

            Comment

            • benny
              Visitor
              • Jun 2013
              • 5

              #7
              Automated file compare

              Hi,

              I tried your suggestion. The problem is that I can't ignore headers and footers in the file when using the folder compare session.

              Comment

              • Aaron
                Team Scooter
                • Oct 2007
                • 16002

                #8
                Hello,

                Can you set a new File Format for you file extension that is used by default for all sessions to ignore the Header and Footer, or would you need to configure it for a specific Folder Compare session only?

                For the default, please follow this guide:
                http://www.scootersoftware.com/suppo..._unimportantv3

                And define a grammar element for the Header, and for the Footer, then uncheck them in the default settings.

                For the specific Folder Compare, it is a bit trickier to setup, but start by saving a Folder Compare that points to your two folders and has your filter already configured. In the Session Settings, Misc tab, have a newly created format that is not used by default (is associated but very low in the list) and uncheck the normal default format. This will cause the lower format to be used only for this session, then re-save the Folder Compare session and load it in scripting.
                Aaron P Scooter Software

                Comment

                Working...