Announcement

Collapse
No announcement yet.

Automating a synchronisation on Mac

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

  • Kerrasdair
    started a topic Automating a synchronisation on Mac

    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!

  • Kerrasdair
    replied
    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.

    Leave a comment:


  • Chris
    replied
    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.

    Leave a comment:


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

    Leave a comment:


  • Aaron
    replied
    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.

    Leave a comment:


  • Kerrasdair
    replied
    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.

    Leave a comment:


  • Aaron
    replied
    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.

    Leave a comment:

Working...
X