RoboCopy Error 50 in PowerShell Script


Author
Message
AnotherStephenG
AnotherStephenG
Junior Member
Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)
Group: Forum Members
Posts: 30, Visits: 84
I can't seem to find anything useful in the forum search. When I search on "any keyword" I get 2,000 results. When I search on "all keywords" I always get a response of "no results". So I'm bringing my troubles here. 

I have a PowerShell script generated by Reflect V6 that I'd managed to modify to get what I wanted: Not synchronization, just copy files in the source folder that have the archive bit set and reset the bit when done. I recently discovered the script is no longer running at all and I can't figure out what the problem is. I've tried changing some of the parameters but I keep getting an Error 50 out of RoboCopy. I managed to figure out how to generate a RoboCopy log, a copy of which I've attached. But I can't find anything useful in it. The only thing that seems "off" to me is the fact that the "Dest" line is delimited by a hyphen instead of a colon, but I don't know if that's significant or what the significance would be. 

I'm really over my head here; I'm just a home user with just enough knowledge to get myself into predicaments such as these. Can anyone suggest what I need to do to get this script working in V7 as I want it to? Thank you. 
AnotherStephenG
AnotherStephenG
Junior Member
Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)
Group: Forum Members
Posts: 30, Visits: 84
I can't even get attachments to work right. Here it is... I  hope.
Attachments
redacted.txt (10 views, 1.00 KB)
jphughan
jphughan
Most Valuable Professional
Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)
Group: Forum Members
Posts: 2.4K, Visits: 16K
I know you mentioned V6, but since you posted in the V7 section, I'm assuming you upgraded.  If so, Macrium Image Guardian allows Robocopy, but only within certain conditions detailed in the MIG KB article.  If that's the issue, you'd have to either make sure your Robocopy operation meets MIG's requirements with respect to the parameters you're using and the properties of the source and destination, or else disable MIG.

Edited 4 February 2018 5:08 AM by jphughan
jphughan
jphughan
Most Valuable Professional
Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)
Group: Forum Members
Posts: 2.4K, Visits: 16K
Just as a follow-up since it looks like MIG doesn't allow the /M parameter you're using, perhaps the /MIR parameter would meet your needs?  It won't reset the Archive bit on the files in the Robocopy source folder, but do you have some reason other than Robocopy to need that bit reset?  And do you need to be able to manually delete some backup files on the Robocopy destination before you delete them from the Robcopy source and NOT have them copied over to the destination again?  If the answer to both of those questions is "No", then /MIR should work fine for you, and it's allowed by MIG as long as the conditions in the KB article are met.

Edited 4 February 2018 5:15 AM by jphughan
Nick
Nick
Macrium Representative
Macrium Representative (2.3K reputation)Macrium Representative (2.3K reputation)Macrium Representative (2.3K reputation)Macrium Representative (2.3K reputation)Macrium Representative (2.3K reputation)Macrium Representative (2.3K reputation)Macrium Representative (2.3K reputation)Macrium Representative (2.3K reputation)Macrium Representative (2.3K reputation)
Group: Administrators
Posts: 1.3K, Visits: 7.2K
AnotherStephenG - 4 February 2018 2:51 AM
I can't seem to find anything useful in the forum search. When I search on "any keyword" I get 2,000 results. When I search on "all keywords" I always get a response of "no results". So I'm bringing my troubles here. 

I have a PowerShell script generated by Reflect V6 that I'd managed to modify to get what I wanted: Not synchronization, just copy files in the source folder that have the archive bit set and reset the bit when done. I recently discovered the script is no longer running at all and I can't figure out what the problem is. I've tried changing some of the parameters but I keep getting an Error 50 out of RoboCopy. I managed to figure out how to generate a RoboCopy log, a copy of which I've attached. But I can't find anything useful in it. The only thing that seems "off" to me is the fact that the "Dest" line is delimited by a hyphen instead of a colon, but I don't know if that's significant or what the significance would be. 

I'm really over my head here; I'm just a home user with just enough knowledge to get myself into predicaments such as these. Can anyone suggest what I need to do to get this script working in V7 as I want it to? Thank you. 

Thanks for posting.

This issue isn't related to MIG and appears to be that the destination isn't supported by the RoboCopy command:

https://serverfault.com/questions/892031/robocopy-error-50-accessing-destination-directory-request-is-not-supported

Kind Regards

Nick - Macrium Support

AnotherStephenG
AnotherStephenG
Junior Member
Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)
Group: Forum Members
Posts: 30, Visits: 84
@jphughan @Nick,

Thank you both. I want to acknowledge that I've seen your replies. It will take me a few days to attempt to digest these and try out some of the options. I will reply when I have some results.
AnotherStephenG
AnotherStephenG
Junior Member
Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)
Group: Forum Members
Posts: 30, Visits: 84
Nick - 4 February 2018 12:30 PM

Thanks for posting.

This issue isn't related to MIG and appears to be that the destination isn't supported by the RoboCopy command:

https://serverfault.com/questions/892031/robocopy-error-50-accessing-destination-directory-request-is-not-supported

Here are the things I've tried to far, each in a separate backup execution:
  • Changed DCOPY and COPY parameters to D and DT respectively
  • Replaced /M with /MIR
  • Removed /M and /MIR
  • Disabled MIG
  • Disabled VPN (just a wild idea I had)
  • Sacrificed a goat
Each run threw Error 50's. 

@Nick I'm looking at your statement above that "the destination isn't supported by the RoboCopy command". I'm now interpreting that to mean there is no fix for this short of changing hardware and/or hardware configuration. Am I correct? The destination drive is just an ordinary external HDD connected to a USB3 port in my router, and it worked just fine in Reflect V6.


jphughan
jphughan
Most Valuable Professional
Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)
Group: Forum Members
Posts: 2.4K, Visits: 16K
If you tested with MIG disabled, then the Reflect version wouldn't come into play anymore since this would just be a regular Robocopy operation at that point.  I am surprised that removing /M entirely and even omitting file and folder attributes from the copy is still generating that error, though, even if you didn't make those changes at the same time.  But just to remove any possibility of involvement with Reflect, have you tried your Robocopy command using some other source folder and set of files to see if you still get that Error 50 copying to that location in that case?  If even that fails, have you maybe updated your router firmware since this last worked?

AnotherStephenG
AnotherStephenG
Junior Member
Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)Junior Member (50 reputation)
Group: Forum Members
Posts: 30, Visits: 84
jphughan - 6 February 2018 8:06 PM
If you tested with MIG disabled, then the Reflect version wouldn't come into play anymore since this would just be a regular Robocopy operation at that point.  I am surprised that removing /M entirely and even omitting file and folder attributes from the copy is still generating that error, though, even if you didn't make those changes at the same time.  But just to remove any possibility of involvement with Reflect, have you tried your Robocopy command using some other source folder and set of files to see if you still get that Error 50 copying to that location in that case?  If even that fails, have you maybe updated your router firmware since this last worked?

I updated my router firmware. A task I'd been putting off so thanks for the motivation. Unfortunately it made no difference.

I did discover that when running a stand-alone RoboCopy as you also suggested, RC isn't happy about paths with embedded spaces. When I changed the folder names to eliminate the spaces, running stand-alone worked fine.

So I renamed my "production" folder to replace the spaces with underscores and updated the backup definition file and the PowerShell script to point to the renamed path. Error 50 again. Which leads me to think it could be something in the PS script? But except for the line of code that invokes RoboCopy, the script is the template generated by Reflect. I'd never even heard of PowerShell until I ran across it in Reflect, so I have no idea how to go about determining where or even if the problem lies in the PS code. 
jphughan
jphughan
Most Valuable Professional
Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)Most Valuable Professional (3.3K reputation)
Group: Forum Members
Posts: 2.4K, Visits: 16K
AnotherStephenG - 7 February 2018 6:26 PM
jphughan - 6 February 2018 8:06 PM
If you tested with MIG disabled, then the Reflect version wouldn't come into play anymore since this would just be a regular Robocopy operation at that point.  I am surprised that removing /M entirely and even omitting file and folder attributes from the copy is still generating that error, though, even if you didn't make those changes at the same time.  But just to remove any possibility of involvement with Reflect, have you tried your Robocopy command using some other source folder and set of files to see if you still get that Error 50 copying to that location in that case?  If even that fails, have you maybe updated your router firmware since this last worked?

I updated my router firmware. A task I'd been putting off so thanks for the motivation. Unfortunately it made no difference.

I did discover that when running a stand-alone RoboCopy as you also suggested, RC isn't happy about paths with embedded spaces. When I changed the folder names to eliminate the spaces, running stand-alone worked fine.

So I renamed my "production" folder to replace the spaces with underscores and updated the backup definition file and the PowerShell script to point to the renamed path. Error 50 again. Which leads me to think it could be something in the PS script? But except for the line of code that invokes RoboCopy, the script is the template generated by Reflect. I'd never even heard of PowerShell until I ran across it in Reflect, so I have no idea how to go about determining where or even if the problem lies in the PS code. 

Well renaming folders works, but for future reference, typically paths with spaces are fine as long as you encase the entire path in double quotes.  Incidentally, that issue might have stood out here had you not redacted all of your path information in the file you attached -- you're not using your bank account information as your folder names or something, are you? Smile

But to confirm, did you verify that your exact "production" Robocopy command, with updated production folder names, is working fine in a standalone context?  If so, then if you'd like to post your PowerShell script here, preferably unmodified (except you may have to change the PS1 extension to TXT for the forum to accept it), then I'd be happy to see if I can help.  If you're not willing to do that, then you can always try creating a new PowerShell script (use PowerShell ISE) whose sole line is your desired Robocopy command and testing with that mini-script.  That will allow you to experiment without having to run a backup each time.

Edited 7 February 2018 6:46 PM by jphughan
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search