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

Best DOS command to move lots of data?

Discussion in 'Software' started by NightWalker, May 14, 2008.

  1. NightWalker

    NightWalker Gigabyte Poster

    1,172
    25
    92
    I have 16GB to move at work. Tried xcopy but it seems to miss bits, the data move ended up 1GB short :blink
    Thought I would try robocopy this weekend and try and sync the two copies of the data, not enough time to move it all again. Anyone have any experience with robocopy, there are a lot of switches to use....
     
    Certifications: A+, Network+, MCP, MCSA:M 2003, ITIL v3 Foundation
  2. zebulebu

    zebulebu Terabyte Poster

    3,748
    330
    187
    Yeps

    Give me a few minutes and I'll dig out the syntax of my usual robocopy batch file for mirroring a directory tree to another share on a different server
     
    Certifications: A few
    WIP: None - f*** 'em
  3. NightWalker

    NightWalker Gigabyte Poster

    1,172
    25
    92
    Cool, thanks zeb.
     
    Certifications: A+, Network+, MCP, MCSA:M 2003, ITIL v3 Foundation
  4. zebulebu

    zebulebu Terabyte Poster

    3,748
    330
    187
    Here ya go

    @ECHO OFF
    SETLOCAL

    SET _source=\\server1\share1
    SET _dest=\\server2\share2
    SET _what=/COPYALL /B /SEC /MIR
    :: /COPYALL :: COPY ALL file info
    :: /B :: copy files in Backup mode.
    :: /SEC :: copy files with SECurity
    :: /MIR :: MIRror a directory tree

    SET _options=/R:0 /W:0 /LOG+:c:\BackupLog.txt
    :: /R:n :: number of Retries
    :: /W:n :: Wait time between retries
    :: /LOG :: Output log file

    ROBOCOPY %_source% %_dest% %_what% %_options%
     
    Certifications: A few
    WIP: None - f*** 'em
  5. NightWalker

    NightWalker Gigabyte Poster

    1,172
    25
    92
    Thanks, I will run a few tests tomorrow on some data.
     
    Certifications: A+, Network+, MCP, MCSA:M 2003, ITIL v3 Foundation
  6. zebulebu

    zebulebu Terabyte Poster

    3,748
    330
    187
    So how did it work out for ya?
    If you need it, there is some excellent documentation and examples for Robocopy here
     
    Certifications: A few
    WIP: None - f*** 'em
  7. NightWalker

    NightWalker Gigabyte Poster

    1,172
    25
    92
    I ran some tests today and tweaked the switches to get it to do what I needed. The data I needed to move was mostly in the new location on the FAP server at Head Office. I told the team leader who’s data it is that I would need to verify the transfer was successful before his staff started using it and not the original copy at the data centre. So he sent a big blanket email the Friday before telling everyone to use the new copy from Monday (this was last Friday). So xcopy failed to deliver the goods, and I was left with this mess! :blink

    Users have been updating files all week on the new copy of the data, the old copy has been static. It made the whole business of re-syncing the data infinitely more complicated (if only they listened...). So I added the /XO switch to your batch file and took out the /MIR (had to add /S and /E too). Tested it moving some files around my C: drive and was happy with the results. So now its all ready to start in a scheduled task at 6am on Sunday. I will let you know the results Monday.
     
    Certifications: A+, Network+, MCP, MCSA:M 2003, ITIL v3 Foundation
  8. NightWalker

    NightWalker Gigabyte Poster

    1,172
    25
    92
    Robocopy, he gets the job done.

    Worked a treat, sorted out the mess! xcopy seems to fall down when there is a lot of data to move. It missed bits, not good. Robocopy filled the gaps, and has enough switches to do exactly what you need it to. So for smaller data moves, less than a few GBs, xcopy will do fine, for everything else there is Robocopy. 8)
     
    Certifications: A+, Network+, MCP, MCSA:M 2003, ITIL v3 Foundation

Share This Page

Loading...