Using snapshots in a scrip\

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gary.lydeen
    New User
    • Oct 2018
    • 2

    Using snapshots in a scrip\

    I'm looking for a little clarification, I'm new to scripting BC (Amazing application BTW).

    I have two folders D:\Hotfolders and G:\Hotfolders, I need to sync D:\Hotfolders --> G:\Hotfolders.

    Below is a simple script. I load a saved folder compare session sync left to right and then save a snapshot.

    Two of the folders I need to sync have around 10 million records so I would like to load that snapshot rather than scan. What is the proper way of doing this?

    Do I simply use the command "load C:\Snapshots\Hotfolders.bcss" in place of load "Hotfolders"? My understanding this will load the snapshot in the left position.

    What command would be used to indicate the destination or the "right" side of the sync.

    # Load the session Hotfolders.
    load "Hotfolders"
    #
    #Confirm Yes to all
    option confirm:yes-to-all
    #
    # Copy different files left to right, delete orphans on right
    sync create-empty mirror:left->right
    #
    # Update the snapshot.
    snapshot include-empty left output:"C:\Snapshots\Hotfolders.bcss"
    #
  • Aaron
    Team Scooter
    • Oct 2007
    • 16000

    #2
    Hello,

    Loading a snapshot is like loading an individual folder representation, rather than a full session, so similar to:
    load "c:\hotfolders" "c:\hotfolders2"
    you could load
    load "c:\hotfolders.bcss" "c:\hotfolders2" (or vice versa if you want the snapshot on the left or the right).

    I would recommend performing the load in the graphical interface so you can see how it works. Please note that a snapshot is useful for a comparison against the snapshot (a virtual moment in time), but the snapshot itself contains no file data and cannot be the source or destination of a sync. Is D: or G: a remote location, and the snapshot would save time over a remote listing/loading? This complicates the script a bit more, since you would compare against a snapshot, then use an expand all command, select side.newer.files side.orphan.files and copyto a third location, then re-generate the snapshot. If the third location is then also remote and also needs the snapshot generation, this probably won't save time over a direct load/comparison.
    Aaron P Scooter Software

    Comment

    Working...