Filter if last modified dates are the same?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nemo
    Visitor
    • Aug 2011
    • 3

    Filter if last modified dates are the same?

    Hi!

    I am doing Folder Sync using scheduled task with script below. My left folder is under a local drive, while my right folder is under a mapped drive from SharePoint.

    load "C:\My Folder" "D:\My Folder"
    expand all
    SYNC create-empty mirror:left->right

    One issue is, which I don't have a clue why, some files on the right (SharePoint) end up in different size (slightly bigger) than files on the left. What happened was that it kept sync these files each time the script is run - which was a waste of time.

    Q1. How can I avoid the file size difference in the first place.

    Q2. If I can't then, how can I use script to exclude/filter these files provided that they have the same last modified dates? I can do this using the application directly, Folder Sync, Session Settings, Sync, choose Mirror to Right, and then choose 'Leave alone' from 'If files are different'. But how can I achieve it using script?

    Any advice is GREATLY APPRECIATED.

    Best,
    Nemo
  • Aaron
    Team Scooter
    • Oct 2007
    • 16017

    #2
    Hello,

    You can set the criteria of the comparison using the script criteria command. Simply use timestamp alone, and no mention of size. The status of Newer, Older and Different apply as follows:
    Newer file has a Newer timestamp, and a content compare is not overriding the timestamp difference.
    Older file has an Older timestamp, and a content compare is not overriding the timestamp difference.
    Different file has equal timestamps, or timestamps are not compared (disabled), and the content (size, binary, or otherwise) is different.

    criteria timestamp:2sec;IgnoreDST
    load "C:\My Folder" "D:\My Folder"
    expand all
    sync create-empty mirror:left->right


    Or you can open your pair of folders in the graphical interface, in a Folder Compare session (Folder Sync sessions are not supported). Setup your comparison in the Session menu -> Session Settings, Compare tab. Then save your session.

    Your script can then load sessionName instead of load a pair of folders.

    Does the size of your files change if you perform the same copy with My Computer or Windows Explorer?
    Aaron P Scooter Software

    Comment

    • nemo
      Visitor
      • Aug 2011
      • 3

      #3
      Hi Aaron!

      Thank you a million. The script works like a charm.

      I don't quite understand this:
      --------------------------------
      Newer file has a Newer timestamp, and a content compare is not overriding the timestamp difference.
      Older file has an Older timestamp, and a content compare is not overriding the timestamp difference.
      Different file has equal timestamps, or timestamps are not compared (disabled), and the content (size, binary, or otherwise) is different.
      --------------------------------

      Just want to understand the mechanism behind this line of script:

      criteria timestamp:2sec

      I looked at BC help content, but still didn't quite understand. The explanation in help content is minimal. Could you please help me understand what is the function behind this script?

      Thanks,
      Nemo

      PS: Yes the file size increased even if I copied it in Windows Explorer. Wired.... Only some files...

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 16017

        #4
        Hello,

        The criteria line sets the current comparison criteria. It is like going into the Session Settings, Comparison tab, and checking the timstamp (which defaults to 2 second tolerance), and unchecking everything else (including size.)

        You mentioned that you wanted to "leave alone" "if files are different." The "Different" in BC3 is a literal status of not newer or older, but different. If the file is newer and timestamps are enabled, it would get a literal status of Newer instead of Different. For example, the display filter of Show Differences shows files that are Newer, Older, Different, and Orphan.
        Aaron P Scooter Software

        Comment

        • nemo
          Visitor
          • Aug 2011
          • 3

          #5
          Hi Aaron!

          Thanks you for your explanation.

          Best.

          Comment

          Working...