No announcement yet.

Basic Scripting Issues

  • Filter
  • Time
  • Show
Clear All
new posts

  • Basic Scripting Issues

    Trying to (finally) automated my BC tasks.I was overconfident, thought I had everything correct, ran the script and promptly deleted 96k files!
    Went back to the beginning and created what I thought was a report difference script - both failed with this message: "1/30/2019 12:15:49 PM Fatal Scripting Error: Loaded session must be Folder Compare session". The scripts I tried are below.

    First I tried using the existing session name:

    log verbose append:"D:\Savethis\BCLog %date%.txt"
    load "E:\ -> F:\ Folder Sync"
    folder-report layout:summary &
    options:display-mismatches,column-attributes,column-timestamp,column-size &

    Second, after seeing the error, I tried this, using a compare session I have:

    log verbose append:"D:\Savethis\BCLog %date%.txt"
    load "E:\ <--> F:\ All Files"
    folder-report layout:summary &
    options:display-mismatches,column-attributes,column-timestamp,column-size &

    Same error - I'm missing something basic but I do not know what it is.
    If I understand the manual correctly, I should only need to use the session name to create/schedule/run a script, EG:

    Load "E:\ <--> F:\ All Files"
    select newer.files older.files

    This fails with "1/30/2019 12:34:40 PM Fatal Scripting Error: Unknown command "load e:\ <--> f:\ all files"

    These are my session names..
    Click image for larger version

Name:	Sessions.JPG
Views:	175
Size:	9.9 KB
ID:	79818

    Bottom line: trying to create 2 scripts - one to run report, one to run an existing session.
    Any help is greatly appreciated!

  • #2

    The scripts look generally alright, but the load command is set to load a specific Folder Compare session named "E:\ <--> F:\ All Files", and there's a space between the F:\ and the All Files. Is that the name of the session? And, is it a Folder Compare session or a Folder Sync session?

    From your screenshot, it looks like the first attempt is a Folder Sync session type (icon), which would fail. The second attempt seems to be missing the exact error text, but do you have two sessions (Sync and Compare) with the same name? The third has "Load" instead of "load".
    Script is very syntax specific, and even a small different in whitespace will cause a failure. I would also attempt to rename your session name, copy and paste the session name text into the script itself, and then surround it with "quotes", as a means to avoid any differences. Also, please double check there are no duplicate names in the list, and that the sessions as Saved as full sessions, and not only as entries in the auto-saved list.

    Folder Compare sessions are required for script. The Folder Sync session offers a subset of commands and a larger preview pane for easy graphical syncing, but the Folder Compare session can also perform the sync steps and is the session type used for reporting, syncing, etc for the automation.
    Aaron P Scooter Software


    • #3
      Yes, I have 2 sync sessions called DtoESync and EtoFSync and 2 compare sessions called DtoEComp and EtoFComp.
      They are saved as full sessions.
      I renamed them per your suggestion.
      Yous said the first session would fail, but you do not say why and that is what I need to know.
      The "Load" vs. "load" in the script should be irrelevant. I understand the whitespace/syntax issue.

      I tried two different ways - script 1:

      # Turn logging on.
      log verbose "D:\Savethis\dtoelog %date%.txt"
      # Load the base folders.
      load "D:" "E:"
      expand all
      # Filter
      filter "*.*,-drive.ico;-DRIVE ICON.ico;-desktop.ini;-desktop*.ini;-CVS\;-Downloads\;&
      -Savethis\;-Media\Torrents\Archive\;-BU - RITZCG\;-BU - System\;-BU - VM\;-Program Installs\;&
      -Local\;-.tmp.drivedownload\;-BU - Misc"
      criteria timestamp:3800sec;IgnoreDST
      # Copy different files left to right, delete orphans on right.
      sync mirror:left->right

      (This script was attempting to duplicate the screenshot session below)

      load "DtoE"
      expand all

      Both fail. The second script seems too simple - do i need to "load <default>" command before "load sessioname"
      I do not understand when you say "Folder Compare sessions are required for the script".
      Are you saying I cannot script a sync session? It shows in example in the help file???

      Below is a screen shot of the sync session
      Click image for larger version

Name:	session.JPG
Views:	212
Size:	64.3 KB
ID:	79825
      I want to run this using task scheduler once per week.
      I use the Compare sessions just to view any differences.
      I'm missing something, please help.


      • #4
        Beyond Compare cannot load saved Folder Sync sessions in scripts. It only supports loading saved Folder Compare sessions. To convert the saved session type, right click on it in the saved session list, then select Save As and set the session type to Folder Compare.

        After you load a saved Folder Compare session, you can use the script "sync mirror" or "sync update" commands to sync files from the Folder Compare session.

        You probably don't need "load <default>" in your script except.
        Chris K Scooter Software