Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2017
    Posts
    6

    Question Automating a synchronisation on Mac

    When Googling how to automate sync in Beyond Compare on Mac, I get the help article explaining how to do this for BC in Windows.

    Is there a concise guide somewhere on how this can be done on a Mac? I've created several sessions all saved with the appropriate left/right folders and sync method. I'd like to simply trigger these on a daily schedule somehow.

    I'm not too familiar with scripting, but I may be able to muddle through. This is where a really useful step-by-step guide would be fantastic.

    Can this be done? Many thanks!

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,623

    Default

    Hello,

    For documentation, we have a section in the Help menu -> Beyond Compare Help, under Using Beyond Compare -> Scripts subchapter. This goes over a basic command line and scripting documentation. There is also a main (bottom) Scripting Reference chapter.

    First, you'll want to use the Beyond Compare menu -> Install Command Line Tools. Then you can use the Terminal to call bcompare. To launch scripting mode, use bcompare @"bcscript.txt"

    The script syntax is mostly cross-platform. Assuming a saved Folder Compare session:
    log verbose "bclog.txt"
    load "session name"
    sync update:left->right

    Folder Sync sessions are not supported in scripting, so you would need to use the Folder Compare session type for saved sessions. Folder Compare sessions also have access to Sync commands, as well as other comparison commands.

    Please note that BC4 does not have an Undo command, and script does not preview before taking an action, so please test with test folders first while learning the syntax and scripting.
    Aaron P Scooter Software

  3. #3
    Join Date
    Aug 2017
    Posts
    6

    Default

    I absolutely will test this first with some test folders, and thank you for the great description Aaron!

    Now to find out how to automate this - Google is my friend.

  4. #4
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,623

    Default

    Windows Task Scheduler is a common strategy, calling to the command line:
    bcompare.exe "@c:\bcscript.txt"

    We have examples of the command line in the Help file -> Using Beyond Compare -> Scripting chapter.
    I'd suggest testing without automation first, from the Windows Command Line, and then integrate with Task Scheduler once that is working. Be sure that they are running as the same Windows User account to share settings, or install a Portable Install of BC4 so that any Windows User running it shares settings.
    Aaron P Scooter Software

  5. #5
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,623

    Default

    Whoops, those instructions assumed Windows without noticing the subforum. For MacOS, you could use Automator or write a bash script manually.
    Aaron P Scooter Software

  6. #6
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    4,610

    Default

    On macOS and Linux, Beyond Compare requires a graphical session (X-Window on Linux) to run, even for a script. This means a Beyond Compare script will not run when a user isn't logged in to the desktop. Windows doesn't have the same dependency, so scripts will run from the Task Scheduler without a user logged in. Removing the graphical session dependency on macOS and Linux is on our todo list for a future version.
    Chris K Scooter Software

  7. #7
    Join Date
    Aug 2017
    Posts
    6

    Default

    Quote Originally Posted by Chris View Post
    On macOS and Linux, Beyond Compare requires a graphical session (X-Window on Linux) to run, even for a script. This means a Beyond Compare script will not run when a user isn't logged in to the desktop. Windows doesn't have the same dependency, so scripts will run from the Task Scheduler without a user logged in. Removing the graphical session dependency on macOS and Linux is on our todo list for a future version.
    Thanks Chris. Being logged in isn't an issue, but thanks for the info.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •