Snapshots from command line

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mbuchichio
    Visitor
    • Jan 2018
    • 4

    Snapshots from command line

    Hi everybody, first post here.
    I looked into the docs and the forums and couldn't find an answer.
    Is it possible to create a folder snapshot from the command line?
    I'm trying to automate that with a bat script.

    Thanks!
  • Aaron
    Team Scooter
    • Oct 2007
    • 15996

    #2
    Hello,

    Yes, using BC Scripting (documented in the Help file -> Using Beyond Compare -> Scripting, and the main Scripting reference chapter).

    The command line itself would be something like:
    bcompare.exe "@c:\script.txt" "c:\pathoffolder" "c:\bcsnapshot.bcss"

    where script.txt contains the snapshot command similar to:
    snapshot include-empty no-filters path:"%1" output:"%2"
    Aaron P Scooter Software

    Comment

    • mbuchichio
      Visitor
      • Jan 2018
      • 4

      #3
      Guess I didn't look hard enough
      Thank you very much.

      Best regards

      Comment

      • mbuchichio
        Visitor
        • Jan 2018
        • 4

        #4
        Any chance of adding par2 or something similar to add redundant data to snapshots for recovery purposes?

        Comment

        • Aaron
          Team Scooter
          • Oct 2007
          • 15996

          #5
          Hello,

          We probably wouldn't add PAR2 to the snapshot, since the goal is to keep snapshots as small as possible and not contain any actual file data.

          How would it work to compartmentalize? Create an associated "PAR2" folder with the number/size of PAR files you need (letting you control the level of recovery options) and keep it next to the snapshot.bcss file. Then you can verify and compare with the snapshot (which can optionally include CRC information), and run a par recovery if ever needed.
          Aaron P Scooter Software

          Comment

          • mbuchichio
            Visitor
            • Jan 2018
            • 4

            #6
            Thanks for the reply, Aaron.

            I understand the file size at a minimum goal, and I found snapshot extremely useful for forensics and validation long term.
            I have been using PAR2 files for validation/recovery and found them extremely useful. I'm actually suprised that people seem to be oblivious of the concept. One of the things that I miss in PAR files is metadata verification. As far as I know, PAR files recover the actual file content and filename, that's it. So I found myself using both PAR and BC snapshots, which to me feel redundant in a way, so I though about 'merging' the PAR functionality with BC.
            I understand that it poses a challenge from a usability standpoint, but on the other hand it feels natural to have the option to heal/reconstruct files besides CRC verification.

            Long story short, I would offer the option to embed the PAR data in the snapshot file for portability (although it's true that the file size will skyrocket), and also the option to generate standalone PAR files along the snapshot.
            In both cases BC would use the PAR data to verify/fix missing or corrupted data.

            Again, I understand that it may not be your aim to add all that to BC, which is a tremendous tool anyway.
            Thanks a lot.

            Comment

            • Aaron
              Team Scooter
              • Oct 2007
              • 15996

              #7
              Appreciated. It's unlikely we'll be able to tackle this project, given the complexity of supporting it well and handling snapshot compatibility for old .bcss handled in newer versions of BC4. Other advantages for keeping it separate is it is compartmentalized: you can upgrade PAR utilities or strategies going forward, but still have fully formed packages in older folders that can compare against newer versions, and all of this is independent of the version of BC you are currently running and the .bcss file.
              Aaron P Scooter Software

              Comment

              • Musfiqul
                New User
                • Dec 2020
                • 2

                #8
                Hi. I need to take snapshot with command line of several folders in C drive(windows, programfiles...). not whole C drive(which takes long time). i did not understand the previous posts. Can you please help: Should i do folder merge or filter folders from session settings? which command line should i use for that. Thank you

                Comment

                • Aaron
                  Team Scooter
                  • Oct 2007
                  • 15996

                  #9
                  Hello,

                  Did you need the real files and file content, or a virtual listing of the file names?

                  Snapshots are a proprietary, virtual file listing that you can use as a fake Folder in the Folder Compare. It represents what you took a snapshot of at a moment in time, so you could compare a past snapshot with a current version and see how the folder has changed, for example.

                  Snapshots cannot be limited by filters. You can save a snapshot of "C:\Program Files" specifically, and have a couple top level snapshots for each folder you need. They are usually quick to generate unless you are including one of the options: CRCs, Exe versions, Archive contents. These require opening and scanning files which can take much longer.
                  Aaron P Scooter Software

                  Comment

                  • Musfiqul
                    New User
                    • Dec 2020
                    • 2

                    #10
                    Hi Aaron,

                    Thankyou so much for the Reply.
                    I Need virtual listing of the files and Folders. like the screenshot-1 attached.

                    Attached screenshot contains whole C: drive. but i Need a snapshot which should contain only C:\programfiles, C:\programdata\qemu-ga and few Folders and subfolders. like the green marked folders in the screenshot-1

                    i can filter Folders like the following:
                    Session> Session Settings> Name filters> Include Folders. there we can write the Folder names and click ok.
                    then Tools> take snapshot.
                    This process i want to do by command/script which i cannot till now.

                    Can you help me? may be there is other way to do so.

                    screenshot-1

                    Comment

                    • RodolfoGiovanninetti
                      Veteran
                      • Oct 2007
                      • 336

                      #11
                      Maybe You can configure settings with the graphic version.
                      Then You save a session.
                      From the script You load that session.
                      And with the snapshot script command You save what You need.
                      Or You can use the filter command inside a script.

                      Regards

                      Rodolfo Giovanninetti


                      Comment

                      • Aaron
                        Team Scooter
                        • Oct 2007
                        • 15996

                        #12
                        Save Snapshot includes all items in the target folder. When loading the snapshot after, you can apply filters to the virtual file, but there isn't a way to exclude them in the generation. Generally, creating a snapshot is a pretty quick process, similar to listing all the items for a comparison.

                        If you disable CRC, Exe, and Archive contents, it shouldn't be too expensive to generate the snapshot at C:\.

                        If you need these more intensive options and want certain folders, you'll need to generate different snapshots for each folder, Such as CProgramFiles.bcss, Cprogramdataqemuga.bcss, at that level.
                        Aaron P Scooter Software

                        Comment

                        • RodolfoGiovanninetti
                          Veteran
                          • Oct 2007
                          • 336

                          #13
                          Aaron, thank You very much for Your help. Since is a subject that might be important to me, I would like to clarify.
                          In the help, in the part related to script, where it describes the snapshot command, it says that there is the parameter
                          ยทno-filters stores all files regardless of the active filename filters.
                          So, I did not test it, but I believed that the filters applied also to snapshot.
                          Do You have to change the documentation?
                          Or I misunderstood something?


                          Thank You again and regards

                          Rodolfo Giovanninetti


                          Comment

                          • Aaron
                            Team Scooter
                            • Oct 2007
                            • 15996

                            #14
                            Actually, you are right!

                            I completely missed that option, and it isn't present in the interface unless a filter is set. If you have a File Name Filter set, then use Tools -> Save Snapshot, you can disable "Items excluded by file filters" to generate a snapshot of only the included items.

                            So set a new base folder of C:\, then set Include or Exclude filters to include or remove specific folders (you can right click the base folders and Exclude to generate that filter name automatically), then generate the snapshot.

                            Script can do this, too, if you load the folder first and use snapshot left|right and do not use no-filters.
                            Aaron P Scooter Software

                            Comment

                            Working...