Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2011
    Posts
    3

    Question 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

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

    Default

    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

  3. #3
    Join Date
    Aug 2011
    Posts
    3

    Default

    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...

  4. #4
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,944

    Default

    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

  5. #5
    Join Date
    Aug 2011
    Posts
    3

    Default

    Hi Aaron!

    Thanks you for your explanation.

    Best.

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
  •