1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Sync Surprise

Discussion in 'Support' started by Peter Bratton, Aug 2, 2010.

  1. Peter Bratton

    Joined:
    Jul 1, 2008
    Messages:
    81
    Likes Received:
    0
    Windows XP SP3 all up to date, TCC 11.00.51

    The SYNC help says about the /N option:
    "Do everything except actually perform the copy. This option is useful for testing the result of a complex SYNC command. /N displays how many files would be copied. /N does not prevent creation of destination subdirectories when it is used with /S."

    Neither, apparently, does it prevent the deletion of destination subdirectories when used with /S and /W.

    I tested this command with the /N option
    SYNC /N/S/E/W .\ "C:\DOCUMENTS AND SETTINGS\UBRAP0\FAVORIS\"

    Its report was as expected:
    69 files would be copied
    SYNC: "C:\Documents and Settings\ubrap0\Favoris\" => D:\y
    0 files would be copied

    So I ran the command without the /N option...
    SYNC /S/E/W .\ "C:\DOCUMENTS AND SETTINGS\UBRAP0\FAVORIS\"

    ...but got an error:
    Usage : SYNC [/A:[[-][+]rhsdaecjot] /CDEGH /I"text" /JKLM /N[dejnst] /O:[-]adegnrstu /OPQR /Sn /TVWX] dir1 dir2

    Except for the /N option, the second command syntax was identical to the first, so why the error message? Because "C:\Documents and Settings\ubrap0\Favoris" no longer existed, the first "test" command had removed it. Surprise!

    I think the behaviour should be corrected or be noted in the help.
    --
    Peter
     
  2. Rod Savard

    Joined:
    May 26, 2008
    Messages:
    481
    Likes Received:
    3
    Wow, that is pretty bad IMO. /N should truly do nothing. I don't even like that caveat as stated in the help file.

    Why create subfolders in a test sitatuaion? If it doesn't exist and sync is being run in test mode, it should assume that all files destined for a missing target folder will be copied.

    Seems very sloppy.
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,868
    Likes Received:
    83
    That assumption won't work, as in some situations the folders cannot be
    created, so a SYNC /N would work and it would fail when the /N was removed.

    Using that approach, I could just alias "SYNC /N" to "REM"! If SYNC doesn't
    create the folders and it doesn't copy the files, exactly what *is* it
    doing??

    Rex Conn
    JP Software
     
  4. thedave

    Joined:
    Nov 13, 2008
    Messages:
    253
    Likes Received:
    2
    On Mon, 02 Aug 2010 19:18:30 -0400, rconn <> was
    claimed to have wrote:


    I thought the point of the "do (N)othing" type switches it to let the
    user inspect the output to determine if the command appears to more or
    less do what was intended without actually doing anything?

    At least that's how I use it on del with complicated wildcards or
    exclusions...
     
  5. Rod Savard

    Joined:
    May 26, 2008
    Messages:
    481
    Likes Received:
    3
    Ok, I can see your point but I'm not sure I personally agree with it.

    Well REM won't show any sort of simulation as to what SYNC might do. The /N, even if it makes some assumptions, should just show a simulation.

    There is no way you can verify that if the simulation works then removing the /N would result in a completely successful SYNC. What if the destination runs out of free space or your quota is exceeded? What if a file is in use in the destination? What if the permissions in the destination do not allow file creation?

    Perhaps it is just my opinion, but I think a "do nothing" switch should really do nothing and only simulate what would happen. It should perform all the read-only checks it can, of course, like verifying that the destination exists.
     
  6. Peter Bratton

    Joined:
    Jul 1, 2008
    Messages:
    81
    Likes Received:
    0
    Indeed, it would be doing nothing. It needs to flag the directories it creates, and delete only those.

    I neglected to state in my first post that FAVORIS contained 5 populated subdirectories -- SYNC /N deleted directories and about 60 files.
    --
    Peter
     
  7. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    Steve Fabian wrote:
    | Rod Savard wrote:
    || Perhaps it is just my opinion, but I think a "do nothing" switch
    || should really do nothing and only simulate what would happen. It
    || should perform all the read-only checks it can, of course, like
    || verifying that the destination exists.
    |
    | I concur. The target should be left as it was.
    Sorry, something stppped sending above from a WiFi location.
    --
    Steve
     

Share This Page