Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2014
    Location
    Milky Way, System Sol, Earth
    Posts
    12

    Default 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"

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

    Default

    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

Tags for this Thread

Posting Permissions

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