Laptop Sync (on Windows)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lyrab
    Visitor
    • Aug 2013
    • 3

    Laptop Sync (on Windows)

    Dear friends,

    I have downloaded Beyond Compare (BC) today. The first impression: great software.

    But now it seems like we fail with a relatively simple task/problem.

    We have a laptop/notebook (with Windows 7) and a NAS (Synology DS112). I would like to have an automatic task that syncs a folder from the NAS to the laptop. In both directions.

    I would start the Sync ever 5 or 10 minutes so that BC updates the folder system automatically whenever a file is changed at whatever place (notebook or NAS).

    It seems to me that we need a script, but I cannot figure out the contents. Can anybody write me a script for this task?

    Thanks.

    Greetings,
    Lyrab
  • Aaron
    Team Scooter
    • Oct 2007
    • 16026

    #2
    Hello,

    We can certainly point you in the right direction.

    First, I would recommend loading up the graphical interface and checking out the Folder Sync session type. If you load this session, and use the Update Both option (to sync in both directions), does the preview pane show the type of sync logic you wish to perform? It would copy Orphans and Newer from one side to the other, and does not delete any other file.

    This can then be scripted. I would recommend first working with a pair of test folders, since script actions are not previewed, and you cannot Undo sync actions in BC3.

    Scripting documentation can be found in the Help file in the Using Beyond Compare chapter -> Automating with Script. The basic command line would be:
    bcompare.exe "@c:\bcscript.txt"

    Where bcscript.txt would contain the script to load and sync your folders. Assuming you can just use the default session settings:
    load "c:\folder1" "c:\folder2"
    sync update:all
    Aaron P Scooter Software

    Comment

    • Lyrab
      Visitor
      • Aug 2013
      • 3

      #3
      Dear Aaron

      thank you very much for your quick reply. I will try this.

      However I have another question: I already saved a workspace with 3 sync tasks and I figured out that I could start it in Windows via the following line:

      "C:\Program Files (x86)\Beyond Compare 3\BCompare.exe" /autosync "Syncs"

      However when I execute this line the following happens: I get a window where I can see a progress bar and an "Auto Sync"-button.



      But nothing happens on its own: After a few seconds the progress bar disappears and the following button appears "Sync now" and nothing happens when I do not press anything.



      Also I would most certainly like all this to happen in the background and not pop up in front when working.

      Is this a viable way or is scripting the better choice for proceeding?

      Thank you again in advance.

      All the best
      L.

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 16026

        #4
        Hello,

        BC3 does not currently support an /autosync command line parameter. We do have /automerge, but that is for the Text Merge session type specifically. We do not have a command line to automatically trigger a sync in the interface.

        The button says 'auto-sync' because it is still currently loading the comparison. Clicking it will queue up a sync to happen automatically after the compare finished (and before you've previewed what will happen, since the comparison is not complete). Once the compare finishes, the button changes to Sync Now, which will trigger immediately.

        Scripting does not support loading a workspace, but does work sequentially through a file. Your script could be:
        load "c:\folder1" "c:\folder2"
        sync update:all
        load "c:\folder3" "c:\folder4"
        sync update:all
        load "c:\folder5" "c:\folder6"
        sync update:all

        Which would load, then sync, each pair of folders, one after the other. The load command can also take in a saved Folder Compare session (load sessionName), but not a saved Folder Sync session.
        Aaron P Scooter Software

        Comment

        • Lyrab
          Visitor
          • Aug 2013
          • 3

          #5
          Dear Aaron

          all right. This all works. I added "closescript" and everything works fine:

          "C:\Program Files (x86)\Beyond Compare 3\BCompare.exe" @"_bcscript.txt" /closescript

          However is there an option that will detect deleted files? If I delete a file on my notebook and synchronise thereafter the file is back again. Instead it would be nice to see the file deleted also on the NAS. Is there an option for this?

          Thank you for your support. I really appreciate this because I like BC3 on first sight, but the documentation is really scarce.

          Greetings,
          L.

          Comment

          • Aaron
            Team Scooter
            • Oct 2007
            • 16026

            #6
            Hello,

            The Update both logic is unable to track deletions. This is because our current support does not have a feature to track the history of the folders; it can open a pair of locations, scan, and apply logic. A file that was added on the right looks the same as a file that was deleted on the left: a right Orphan. We can customize the logic to copy or delete; it defaults to copy.

            Adding support to remember a previous scan and track deletes is something on our wishlist.

            If you have any additional questions, please be sure to let us know.
            Aaron P Scooter Software

            Comment

            • chrroe
              Pooh-Bah
              • Oct 2007
              • 588

              #7
              Hi everyone,

              isn't it possible to use the archive bit of a file to determine, if a file was deleted or added?
              When it is set, I would suggest that it was recently copied to its loaction.

              When the bit is not set, usually the pendant on the other side seems to be deleted. To use this mechanism you must make sure, that directly after a sync all archive bits are cleared.

              Any thoughts?

              Bye
              Christoph

              Comment

              • Aaron
                Team Scooter
                • Oct 2007
                • 16026

                #8
                Thanks for the ideas and feedback, Christoph. Unfortunately, the Archive bit is potentially altered by the OS or other programs. I believe a scenario like this was Archive's original purpose, but there are situations where it can be updated externally (similar to Excel updating "Last Modified" even if the file is only opened and viewed, not modified). This is certainly an option, but there might be better methods.

                It's definitely still a project we want to tackle, and we have a few ideas about how to best do it.
                Aaron P Scooter Software

                Comment

                Working...