locked
Question about how the Robocopy /B switch works... RRS feed

  • Question

  • I've been experimenting with robocopy recently, and most switches seem self explanatory for the most part; although I have a question about the /B switch.

    The help says the following:

    /B :: copy files in Backup mode.

    I've checked multiple forums and websites to try and elaborate on this a little more, and from my understanding this switch enables backup mode that essentially gives the ability to change the acls of a file/folder when the account running robocopy does not have sufficient privileges, to perform a successful copy.

    My question is, when the acls are changed when using this "backup mode" switch, with the /copyall switch, will the file still retain the same user access that it originally had - or does it change all of the security settings?

    I'm hoping it will somehow change the security settings, create a copy, and retain the same acls as the original - so users can still access necessary files.

    Can someone please explain how this "backup mode" works?

    Thanks in advance.

    Saturday, December 17, 2011 12:44 AM

Answers

  • /B (backup mode) will allow Robocopy to override file and folder permission settings (ACLs).

    Backup mode requires RC to be run fromaccount with enough privileges to accomplis this trick.  Normally RC respects teh ACL restrictions.

    If you sepcify backup odf security info it will still be backed up.  That should be independent of the backup mode setting.

     

     


    jv
    • Proposed as answer by Bigteddy Saturday, December 17, 2011 6:21 AM
    • Marked as answer by Kyle B Saturday, December 17, 2011 1:59 PM
    Saturday, December 17, 2011 1:21 AM

All replies

  • /B (backup mode) will allow Robocopy to override file and folder permission settings (ACLs).

    Backup mode requires RC to be run fromaccount with enough privileges to accomplis this trick.  Normally RC respects teh ACL restrictions.

    If you sepcify backup odf security info it will still be backed up.  That should be independent of the backup mode setting.

     

     


    jv
    • Proposed as answer by Bigteddy Saturday, December 17, 2011 6:21 AM
    • Marked as answer by Kyle B Saturday, December 17, 2011 1:59 PM
    Saturday, December 17, 2011 1:21 AM
  • I want both the source and the destination to retain the same acls.

    When you say "Robocopy to override file and folder permission settings (ACLs)," using the /copyall switch will still keep all acls as is with /b - correct?

    Just making sure RC behaves.

    • Marked as answer by Kyle B Saturday, December 17, 2011 1:58 PM
    • Unmarked as answer by Kyle B Saturday, December 17, 2011 1:58 PM
    Saturday, December 17, 2011 1:30 AM
  • If you sepcify backup odf security info it will still be backed up.  That should be independent of the backup mode setting.

     

     


    jv
    I think jv already answered your last question about using /copyall.

    ([string](0..9|%{[char][int](32+("39826578846355658268").substring(($_*2),2))})).replace(' ','')
    Saturday, December 17, 2011 6:23 AM
  • Great, thanks guys.
    Saturday, December 17, 2011 1:59 PM
  • I have a question - more of a pragmatic one.  Is there ever a drawback to adding the /b to a robocopy script?  If you have an admin account and can circumvent the inevitable ACL problems one is likely to face during a migration or backup, wouldn't it make sense to always just add /b? 

    I'm planning for a big migration and I've tested with /b.  I've purposely set up a test environment where I don't have access to certain files and folders (either by not having permissions, or being explicitly denied via the "deny" attribute) and /b can migrate those files to a different volume every time! 

    Any help/advise/insight would be greatly appreciated.

    Regards,

    -boss

    Thursday, February 23, 2012 9:41 PM
  • Hi,

    This question has been closed for a while now. Also, since your question deals with a standard Windows command (robocopy), you should ask in a more appropriate forum (this forum is for scripting questions).
    Bill

    Thursday, February 23, 2012 9:48 PM
    Moderator
  • Way to go - "this question has been closed"...

    This thread is the top hit when you Google for answers to questions about exactly what /B does. Frankly the documentation does NOT elaborate on what "backup mode" is. I'm sure there is some documentation somewhere on Technet, but it's certainly not easy to find if there is.

    I too want an answer to the questions "boss" asked in his post, even though he asked them exactly two years ago now.

    And there exist very few other threads in fora online about /b mode.

    So if anyone can chime in with some technical information to answer the question instead of simply "stop posting in the wrong forum" or "this question is now closed", that would be ... you know - useful.

    Saturday, February 22, 2014 6:13 PM
  • If you post in the correct forum you will get an answer.  The correct forum for ROboCopy depends on the OS you are suig.  POst in the OS forum for your version of Windows.

    Each version of Windows can have a different version of RoboCopy. (WS2003 and earlier did not come with RoboCopy.  Windows 7 and later do)

    RoboCopy is not a script or scripting component.  It is a system utility.


    ¯\_(ツ)_/¯

    Saturday, February 22, 2014 6:19 PM
  • I should also note that the term "backup mode" is a Windows system definition. The platform people can explain what a backup is. It is slower that a fast copy with RoboCopy which cannot copy open files. Special system functions are required when we need to use backup to copy a file.

    If you are unsure what a backup is I recommend contacting your system Admins as they should be able to show you how these are different.  The MVPs in the platform area can also help you to understand what a backup is. (Note that "backup" here is not the dictionary definition)


    ¯\_(ツ)_/¯

    Saturday, February 22, 2014 6:25 PM
  • Search engines can be useful for finding information...

    http://www.google.com/search?q=windows+backup+mode

    The first result is an article about robocopy, and it talks about /B.

    There you go: A description of the robocopy /B parameter.

    (Don't be helpless: You can find information too, if you try.)

    Bill


    Sunday, February 23, 2014 3:18 AM
    Moderator
  • Search engines can be useful for finding information...

    http://www.google.com/search?q=windows+backup+mode

    The first result is an article about robocopy, and it talks about /B.

    There you go: A description of the robocopy /B parameter.

    (Don't be helpless: You can find information too, if you try.)

    Bill


    FYI, this post is the first result when searching: http://www.google.com/search?q=robocopy+backup+mode

    The thread answered my question and was useful without the added criticism.

    Thursday, April 24, 2014 10:47 AM
  • The thread answered my question and was useful without the added criticism.

    The "criticism" certainly was not directed at you, but rather at the OP, who posted a question that could have been easily answered by a quick web search. This is always rule #1 before posting a question to a forum: Did you search first?


    -- Bill Stewart [Bill_Stewart]

    Thursday, April 24, 2014 2:23 PM
    Moderator
  • This is a very useful thread with a lot of hostility in it.

    I have to agree with Jonathan and hazymat: there are few other forums that will discuss the exact function of /b switch, the TechNet article just says "copies in Backup Mode" (I have the article bookmarked), and when doing a google search, THIS page comes up as the top result! Kinda difficult to tell people they should go search, when you are the exact destination of that search, isn't it? ;)

    No offense to anybody working hard to help out here, but this is why sites like Stack Exchange will overshadow every traditional tech forum very soon. More concise question/answer format, more civil, and they actually encourage old questions developing new answers! All q&a is cataloged for future reference. Their focus is on being a 'resource'.

    The negativity here is unfortunate, you guys have great potential to be a very helpful resource for people. Who are you trying to be, the guys with all the answers, or the guys who say "get out of here, your answer isn't in here. Go search for it."?

    Regardless, many thanks to jrv! for helping me with my robocopy batch SCRIPT which I just used to create an automated backup! Take care boys. And yes, I just bumped your old-old thread.

    Thursday, May 1, 2014 7:49 PM
  • This is a very useful thread with a lot of hostility in it.

    I have to agree with Jonathan and hazymat: there are few other forums that will discuss the exact function of /b switch, the TechNet article just says "copies in Backup Mode" (I have the article bookmarked), and when doing a google search, THIS page comes up as the top result! Kinda difficult to tell people they should go search, when you are the exact destination of that search, isn't it? ;)

    No offense to anybody working hard to help out here, but this is why sites like Stack Exchange will overshadow every traditional tech forum very soon. More concise question/answer format, more civil, and they actually encourage old questions developing new answers! All q&a is cataloged for future reference. Their focus is on being a 'resource'.

    The negativity here is unfortunate, you guys have great potential to be a very helpful resource for people. Who are you trying to be, the guys with all the answers, or the guys who say "get out of here, your answer isn't in here. Go search for it."?

    Regardless, many thanks to jrv! for helping me with my robocopy batch SCRIPT which I just used to create an automated backup! Take care boys. And yes, I just bumped your old-old thread.

    Unfortunately I think you miss the point.  RoboCopy is an application.  It is not a script.  This is a scripting forum.  Many people come here nd never read the forum guidelines and do not ask script related questions.

    The /b switch is documented in RoboCopy help.  Of course it assumes the reader is a trained Windows tech and knows what backup mode is.  It is used by nearly all backup software when backing up a live system..


    ¯\_(ツ)_/¯

    Thursday, May 1, 2014 8:19 PM
  • To be certain I searched.  It was the first entry in the list not including the opening ads.

    ¯\_(ツ)_/¯

    Thursday, May 1, 2014 8:22 PM
  • It isn't hostility. It's simply that people are asking questions that can be answered by searching. There are lots of things written on the correct way to ask a technical question. #1 on everyone's list is: "Search first."

    Here are some implications of "did you search first?"
    1. We're assuming that you will be able to look at the information from search results and determine whether it answers your question (in whole or part). There is no service-level agreement in a search tool (or this forum, for that matter) that guarantees the very first result (or even the very first page of results!) will give you the answer you're looking for.
    2. If a search result gives you part of an answer, you can use the partial answer(s) to continue your search. Open another browser window or tab and keep searching! Don't give up if the first page of answers doesn't tell you everything you need to know.
    3. If you really run out of ideas when searching, try to demonstrate that you're not helpless and tell forum respondents what you searched for and how/why the results didn't answer your question. This will show that you put forth effort into finding your own answer and will go a long way towards heading off responses such as "Don't be helpless: You can find information too, if you try."

    -- Bill Stewart [Bill_Stewart]

    Thursday, May 1, 2014 8:50 PM
    Moderator
  • Who gives a dam which forum it is, if its a topic already running then so be it.  Understandable if someone posts a question and is redirected to the correct forum but if there is already a running thread what difference does it make.  Get a life!
    Thursday, July 17, 2014 6:44 PM
  • The reason it matters is because we want to avoid polluting the forum with off-topic and unanswerable drive-by questions.

    -- Bill Stewart [Bill_Stewart]

    Thursday, July 17, 2014 7:03 PM
    Moderator