Results 1 to 12 of 12

Thread: Using Robocopy

  1. #1
    Lounger
    Join Date
    Apr 2010
    Location
    Minneapolis, MN
    Posts
    34
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Using Robocopy

    Greetings -

    I have been using batch files with the xcopy command for quite some time for backing up my data. I am interested in seeing if ROBOCOPY might do a better job for me, but the published ROBOCOPY switches in various postings seem confusing. In particular there doesn't seem to be an equivalent to xcopy /D. I'm guessing that /M or /XO might do it, but it's unclear, and I don't want to mess up my files. Any input would be appreciated. Here is one of the xcopy sequences I use. Can someone post the ROBOCOPY equivalent? Thanks.

    Casey H.
    E:
    cd\E-Mail
    xcopy "E:*.*" "Y:\E-Mail\" /y/d/s/r
    cd\files
    xcopy "E:*.*" "Y:\Files\" /y/d/s/r
    cd\Palm OS Desktop
    xcopy "E:*.*" "Y:\Palm OS Desktop\" /y/d/s/r
    cd\Thunderbird Profiles
    xcopy "E:*.*" "Y:\Thunderbird Profiles\" /y/d/s/r

  2. #2
    Super Moderator bbearren's Avatar
    Join Date
    Dec 2009
    Location
    Polk County, Florida
    Posts
    2,381
    Thanks
    14
    Thanked 238 Times in 190 Posts
    Start > Help and Support. Type robocopy in the search bar.
    Create a new drive image before making system changes, in case you need to start over!

    "Let them that don't want it have memories of not gettin' any." "Gratitude is riches and complaint is poverty and the worst I ever had was wonderful." Brother Dave Gardner "Experience is what you get when you're looking for something else." Sir Thomas Robert Deware. "The problem is not the problem. The problem is your attitude about the problem. Do you understand?" Captain Jack Sparrow.
    Unleash Windows

  3. #3
    Lounger
    Join Date
    Apr 2010
    Location
    Minneapolis, MN
    Posts
    34
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Still having issues but I think I am closer. At least I'm no longer getting invalid syntax messages. Again, I'm trying to create a script that copies everything new (or changed) from my E drive to my F drive. I'm also trying to copy a TrueCrypt file container on the E drive that has no file extension, regardless of change status. That's where the difficulty arises. There's also probably a better way to handle the recycle bin and the system volume information folder. Here it is:

    E:
    cd\
    robocopy E: F: /E /XO /XD $Recycle.bin /XD "System Volume Information"
    E:
    cd\
    robocopy E: F: Truecrypt.*

  4. #4
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    6,237
    Thanks
    202
    Thanked 796 Times in 729 Posts
    Casey,

    FWIW here's the file I use to keep my Documents backedup.
    Code:
    Echo Off
    REM  Updated: 10/27/10
    Echo.  -------- Copying BEKDocs to V: drive -------
    Robocopy "G:\BEKDocs" "V:\BEKDocs" /MIR /XJD /R:5 /W:15 /MT:32 /V /NP /LOG:RoboCopy.log 
    Echo.  -------- Copy Completed              -------
    May the Forces of good computing be with you!

    RG

    VBA Rules!

    My Systems: Desktop Specs
    Laptop Specs


  5. The Following User Says Thank You to RetiredGeek For This Useful Post:

    Casey H (2011-12-05)

  6. #5
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    2,833
    Thanks
    19
    Thanked 110 Times in 104 Posts
    Here's my "copy C: drive to backup" BATch file. Some of the code is not shown, but it should be easy enough to detect this!
    Code:
    set source=C:
    set target=E:\RoboCopy of %computername% C drive\%dow%\
    set opts=/copyall /mir /np /r:0 /w:0 /fft /ndl /xj
    if defined win7 set opts=%opts% /dcopy:t /dst /mt
    set optsxd=/xd $Recycle.bin Boot Recycler "System Volume Information"
    set optsxd=%optsxd% "Local Data" "Kaspersky Lab" cache bases winsxs
    set optsxf=/xf bootmgr hiberfil.sys pagefile.sys
    robocopy "%source%" "%target%" %opts% %optsxd% %optsxf% >>%log%
    BATcher

    Dear Diary, today the Hundred Years War started ...

  7. The Following User Says Thank You to BATcher For This Useful Post:

    Casey H (2011-12-05)

  8. #6
    Super Moderator bbearren's Avatar
    Join Date
    Dec 2009
    Location
    Polk County, Florida
    Posts
    2,381
    Thanks
    14
    Thanked 238 Times in 190 Posts
    I use Robocopy for other things, but the only backup method I use is drive images. And I don't use incrementals of any kind; I do complete drive (actually partition) images. This is the reason I use partitions more than most; it facilitates my backup method quite well, and although it may not look like it, it is quite simple.

    For more information, visit Partitioning/Backup Options, which was written when I was running XP, but it still applies to Windows 7. I use the same basic methodology for my Windows 7 Ultimate installation, which has 15 partitions spread over two 1TB HDD's; Needless to say, I don't stay in Microsoft's box; I run Windows the way I want it to run.

    My methods are not for the inexperienced user, but they work well for me.
    Create a new drive image before making system changes, in case you need to start over!

    "Let them that don't want it have memories of not gettin' any." "Gratitude is riches and complaint is poverty and the worst I ever had was wonderful." Brother Dave Gardner "Experience is what you get when you're looking for something else." Sir Thomas Robert Deware. "The problem is not the problem. The problem is your attitude about the problem. Do you understand?" Captain Jack Sparrow.
    Unleash Windows

  9. The Following User Says Thank You to bbearren For This Useful Post:

    Casey H (2011-12-05)

  10. #7
    Lounger
    Join Date
    Apr 2010
    Location
    Minneapolis, MN
    Posts
    34
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Thanks All -

    I'll give some of these a try. Basically everything is working ok for me except I can't copy a file that's in the root of my E drive. It is not in a folder at all. Trying to copy all of the folders on my E drive is also what gave me the access errors for the recycle bin and the system volume information folder, which I certainly had no desire in copying. The file name also does not have an extension, although I don't see why that would matter. The log seems to see the file, but it shows that it doesn't copy it.


    Casey H.

  11. #8
    Lounger
    Join Date
    Apr 2010
    Location
    Minneapolis, MN
    Posts
    34
    Thanks
    6
    Thanked 0 Times in 0 Posts
    I think I have found the problem. Apparently a default robocopy setting is to leave out files unless the date or size changes. The truecrypt file container I am trying to copy neither changes its size or date. I guess I need a switch that over-rides this and forces a copy regardless. Thanks.

    Casey H.

  12. #9
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    2,833
    Thanks
    19
    Thanked 110 Times in 104 Posts
    I've just tried the following:
    Code:
    D: & cd \
    echo Hello World > Truecrypt
    robocopy d: e: Truecrypt
    del e:\Truecrypt
    robocopy d: e: Truecrypt.*
    and both Robocopies copied the required file... (Win7Pro-64)
    BATcher

    Dear Diary, today the Hundred Years War started ...

  13. The Following User Says Thank You to BATcher For This Useful Post:

    Casey H (2011-12-05)

  14. #10
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    2,833
    Thanks
    19
    Thanked 110 Times in 104 Posts
    Our posts crossed!
    When I copy directories of files, I like to update the timestamp on the target directory to the date and time of the backup copy. I do this by creating a dummy file inside the target directory, which forces the update of the date and time on the directory, then deleting it. You might like to investigate this technique with the source Truecrypt container?
    BATcher

    Dear Diary, today the Hundred Years War started ...

  15. The Following User Says Thank You to BATcher For This Useful Post:

    Casey H (2011-12-05)

  16. #11
    Lounger
    Join Date
    Apr 2010
    Location
    Minneapolis, MN
    Posts
    34
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Thank You All -

    I got this to work as was recommended by deleting the existing destination file first. That makes me nervous, however, as this is a really important file. I have multiple backups of it, of course, but I'd hate to end up with multiple files that all have the same error. Unless anyone sees any issues with it, I think I'll stick with xcopy for this particular file--the copy speed difference does not appear to be noticeable. Thanks again.

    Casey H.

  17. #12
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    2,833
    Thanks
    19
    Thanked 110 Times in 104 Posts
    Copying should take roughly the same time by whatever program unless it's possible to use several threads (as with Robocopy). If you are copying a single file, then multithreading has no applicability.
    BATcher

    Dear Diary, today the Hundred Years War started ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •