Re: With Robocopy can I just show files that were skipped due to being newer in the destination?

Discussion in 'Windows Server' started by Pegasus \(MVP\), Dec 1, 2008.

  1. Standard redirection stuff:
    robocopy d:\temp d:\Mon *.txt /xo /v | find /i "older"
     
    Pegasus \(MVP\), Dec 1, 2008
    #1
    1. Advertisements

  2. Thanks, Pegasus.
    Great suggestion -- I wasn't even aware of that find command. The
    only issue is that I wanted a concise log that only listed the
    exceptions, and that /v (verbose) flag causes the log to be too long.
    So, using your idea, I came up with a 2-3 step solution that allows me
    to have the concise log and still check for "older" files. Let me
    know if you can think of a better way (although I still think Robocopy
    should have as an option to show these "older" files alongside the
    "extra" ones without having to use the verbose option).

    1. first I run this to actually do the backup and list any Extra
    files:

    robocopy E:\Workspace\CW2008\Production E:\Workspace\CW2008\Backup /r:
    10 /xo /log+:RoboLog.txt /s /np

    and look through the log for any "EXTRA" files or directories


    2. then run this to check for files not backed-up due to the
    destination copy being NEWER:

    robocopy E:\Workspace\CW2008\Production E:\Workspace\CW2008\Backup /r:
    10 /xo /s /np /v | find /i "older"


    3. if you see any output from #2, use the log from this command to
    find the specific location of the file(s):

    robocopy E:\Workspace\CW2008\Production E:\Workspace\CW2008\Backup /r:
    10 /xo /log:RoboLogVerbose.txt /s /np /v

    ==============

    I'm not quite with you. You write " I wanted a concise log that
    only listed the exceptions", and this is precisely what the command

    robocopy d:\temp d:\Mon *.txt /xo /v | find /i "older"

    does: It lists the exceptions, nothing more, nothing less.
     
    Pegasus \(MVP\), Dec 22, 2008
    #2
    1. Advertisements

  3. Sorry, you are right -- it is just that I also wanted to keep the
    format of the log where it lists the files that were copied and the
    "Extra" files. What I meant by concise was not listing all of the
    files like the verbose option does. But your command was very helpful
    - I just have to live with the multiple steps.

    Thanks again for your help.

    =======================

    This is called "scope creep" - having one set of specs at first, then
    modifying them as time goes by . . .

    If your multiple steps do the trick, fine. If they don't then the usual
    method would be to massage the log file with a script. If you were to post a
    short sample of the verbose report, then a manually edited version of what
    you would really like to see then I could tell you if this would be a
    trivial exercise or a big effort.
     
    Pegasus \(MVP\), Dec 22, 2008
    #3
  4. <snip>
    Thanks - below is the output with /v. I simply want to remove all the
    lines that have "same" in front of them.

    same 20.5 m BidChanges_ATTW-YPC-04-25-2008.xls
    same 2.0 m BidChanges_ATTW-YPC-04-25-2008_Google.xls
    <snip>
    ========================
    I asked for a "short" sample - please don't post a large number of
    repetitious lines.

    I strongly recommend that you familiarise yourself with "find.exe", e.g. by
    typing "find /?" at the Command Prompt. It is a very useful command for a
    server administrator. You will immediately see that you can achieve your aim
    like so:

    robocopy /.. /.. | find /i /v " same " > c:\robocopy.txt
     
    Pegasus \(MVP\), Dec 24, 2008
    #4
  5. Thanks for the quick response, Pegasus. That's a great solution that
    will definitely save me a lot of time. I didn't realize that you
    could "log" out by just putting ">" at the end of the line - I would
    have tried a pipe, which obviously wouldn't have worked. It does look
    like the find command is very handy - I'll definitely remember this
    design pattern. Thanks again for all your help - you gave me faith
    again in Usenet after all these articles saying it was dead, and
    thinking that so many helpful people have moved on to forums and sites
    like experts-exchange.com (I posted this question there for 500 points
    and it STILL hasn't been answered!).

    =====================

    The pipe character | will direct the output from one command into another
    command. It can be concatenated as many times as you like, e.g. like so:

    robocopy /.. /.. | find /i /v " same " | find /i ".xls"

    If you leave the above command as it is then the output will be directed to
    the screen. If you add the redirection character > then the output will be
    directed to the file or device you specify:

    robocopy /.. /.. | find /i /v " same " | find /i ".xls" > c:\robocopy.txt

    If you don't want the user to see the standard output then you direct it to
    the "null" device:

    robocopy /.. /.. > nul
    which is the same as
    robocopy /.. /.. 1> nul

    And if you don't want him to see the error output then you do it like so:

    robocopy /.. /.. 2> nul
    or like so:
    robocopy /.. /.. 1>nul 2>nul

    If you want a more versatile command to locate various strings in your
    output then you should use findstr.exe instead of find.exe.

    I'm aware of Experts-Exchange but I am reluctant to subscribe. So far I have
    always found the information I was after by googling for the right keywords.

    Thanks for the feedback.
     
    Pegasus \(MVP\), Dec 24, 2008
    #5
  6. Pegasus \(MVP\)

    Mikey

    Joined:
    Apr 21, 2012
    Messages:
    1
    Likes Received:
    0
    I seem to be missing a skipped directory

    It's unfortunate that a distinct "*SKIPPED" tag, a la the "*EXTRA" tag, does not appear to explicitly identify something that was skipped. That said, I recently Robocopied a largish hard drive to a new (i.e., empty, almost) backup drive, and was told that 3 Dirs and 2 Files were skipped. However, I can only find 2 Dirs that were skipped.

    To narrow down the search, I eliminated all the "New Dir" and "New File" lines, and was left with the following (line numbers prepended):

    1
    2 -------------------------------------------------------------------------------
    3 ROBOCOPY:: Robust File Copy for Windows
    4 -------------------------------------------------------------------------------
    5
    6 Started : Fri Apr 20 22:18:46 2012
    7
    8 Source : \\mfa-GYFMQC1\E-Drive\
    9 Dest : e:\
    10
    11 Files : *.*
    12
    13 Exc Dirs : $RECYCLE.BIN
    14 System Volume Information
    15
    16 Options : *.* /V /S /E /COPY:DAT /NP /XO /R:3 /W:2
    17
    18 ------------------------------------------------------------------------------
    19
    20 4 \\mfa-GYFMQC1\E-Drive\
    21 *EXTRA File 0 robocopy.DtoH.log
    22 older 1736 Robocopy commands.txt
    23 same 7113 robocopy.txt
    26 named -1 \\mfa-GYFMQC1\E-Drive\$RECYCLE.BIN\
    27 named -1 \\mfa-GYFMQC1\E-Drive\System Volume Information\
    49715
    49716 ------------------------------------------------------------------------------
    49717
    49718 Total Copied Skipped Mismatch FAILED Extras
    49719 Dirs : 8726 8723 3 0 0 0
    49720 Files : 40968 40966 2 0 0 1
    49721 Bytes : 28.981 g 28.981 g 8.6 k 0 0 0
    49722 Times : 0:19:41 0:18:59 0:00:00 0:00:42
    49723
    49724
    49725 Speed : 27305705 Bytes/sec.
    49726 Speed : 1562.444 MegaBytes/min.
    49727
    49728 Ended : Fri Apr 20 22:38:28 2012


    I see the 2 skipped files at lines 22 and 23, but only 2 skipped directories, at lines 26 and 27 (the directories I explicitly excluded). How can I find out what the 3rd skipped directory was? NOTE: Erratic spacing and the smiley in line 16 are forum artifacts, not mine.
     
    Last edited: Apr 21, 2012
    Mikey, Apr 21, 2012
    #6
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.