script to create session (warning: newbie to BC)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • michael.weisman
    Journeyman
    • Oct 2014
    • 12

    script to create session (warning: newbie to BC)

    Please be patient, I'm very new to BC.
    I am trying to automate the process of creating the baseline snapshots for several hundred servers.
    This script is supposed to open \\server\ddrive$\apps\directory, select all exe and dll files, excluding anything in .\LOG and save a snapshot of the crc values for the desired files, creating the base folder "D:\BC_SNAPSHOT\Server_Snapshot_Folder" and saving the session in
    D:\BC_SNAPSHOT\Server_Snapshot_Folder\Filename.bcs s

    Would the following work?
    BCompare.exe "@c:\createsession.txt" "\\server\ddrive$\apps\directory"



    createsession.txt
    option confirm:yes-to-all

    # Compare using crc.
    criteria crc

    # Filter to only include exe and dll, ignore log subfolders.
    filter "*.exe;*.dll;-LOG\"

    # Load current files and creates base folder
    load "\\server\ddrive$\apps\directory" "D:\BC_SNAPSHOT\Server_Snapshot_Folder"

    # Expand to affect subfolders and files.
    expand all

    # Select all files in scope
    select all

    # Save the snapshot.
    snapshot save-crc left output:"Filename.bcss"
  • Aaron
    Team Scooter
    • Oct 2007
    • 16002

    #2
    Hello,

    Yes, that script looks solid with one minor tweak. The log filter, if only on the base folder, should be "-.\LOG\"

    If the server is unavailable, you'll hit a "Cannot load base folder" error, which will end the script call.

    You can verify the generated snapshot in the GUI, and enable the CRC column by right clicking any existing column header (Name, Size, Modified) and then adding CRC.
    Aaron P Scooter Software

    Comment

    Working...