Announcement

Collapse
No announcement yet.

Snyc Mirror Question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Snyc Mirror Question

    I want to sync one way (T:\ -> Z:\T\). I want all orphaned files on the right deleted.

    I also want to use timestamp and CRC as the criteria.

    Will this script work?

    load t:\ z:\t\
    criteria timestamp:2sec;CRC
    sync create-empty mirror:lt->rt

    Or is there something that I am missing?

    Should I be doing anything with the expand all command?

    Also, how is this different from the sample script:


    # Turn logging on
    log normal "C:\My Documents\Webpage\Synclog.txt"
    # Load the default session and exclude all but certain file types
    load <default>
    criteria timestamp size
    filter "-RECYCLER\;-System Volume Information\"
    # Load the base folders
    load "T:\" "Z:\Thebes"
    expand all
    # Copy left newer, different, and orphans to FTP site
    select lt.newer.files lt.diff.files lt.orphan
    copy lt->rt
    # Delete any orphaned files on FTP site
    select rt.orphan
    delete rt

  • #2
    Re: Snyc Mirror Question

    According to the help file:

    Code:
    Mirror makes the target folder identical to the source one. Newer, older, different, 
    and orphaned files are all copied to the destination, and orphans in the destination are deleted. 
    The all direction doesn't apply in this context, and is not valid.
    So, it would appear that all left side files are copied to the right side, regardless of timestamp or comparison criteria.

    The script you provided would copy left side newer, different, orphan files to the right, and then delete right side orphans.

    Comment


    • #3
      Re: Snyc Mirror Question

      Ah OK... so in the first one - how are the files considered to be different? Does sync support the criteria command?

      Thanks,
      Steven

      Comment


      • #4
        Re: Snyc Mirror Question

        sync mirror will make the target side identical to the source, according to the current comparison criteria.

        Here's the best script for this:

        criteria binary
        load t:\ z:\t\
        sync create-empty mirror:lt->rt

        CRC comparison is a little bit slower than binary, unless you have CRC values already computed (snapshots, zip files, FTP servers that support CRC generation).

        Also, if you're doing a binary content comparison, timestamp comparison doesn't really matter, unless you need to make sure all of your timestamps are in sync.

        Last, binary comparison requires reading the file contents for comparison. It might be slightly faster to just copy all files every time.

        load t:\ z:\
        select all
        copy lt->rt
        expand all
        select rt.orphan.files
        delete rt
        Chris K Scooter Software

        Comment


        • #5
          Re: Snyc Mirror Question

          Just to add a detail...

          I was recently trying to do a synch mirror command and I found that even with the only criteria being binary, if during the synch a file was in each location and found to be different, but the file on the destination had a 'newer' timestamp BC (or maybe windows, ftp software,etc) was prompting to overwrite a 'newer' file with older. But I couldn't 'see' them as I was running /silent so the files were not updated.

          From the example you gave
          Code:
          criteria binary
          load t:\ z:\t\
          sync create-empty mirror:lt->rt
          I found adding
          Code:
          option confirm:yes-to-all
          Fixed the problem.

          Again, I'm not sure if this was beyond compare or windows, ftp software, etc that was prompting for overwrite, but the confirm fixed the problem

          Comment

          Working...
          X