SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Robocopy false error code of 8 when executed from SQL


Robocopy false error code of 8 when executed from SQL

Author
Message
ktalley.dba
ktalley.dba
Forum Newbie
Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)

Group: General Forum Members
Points: 8 Visits: 1060
I am trying to call robocopy from a bat fie to move backups to a network server. This is working fine on several servers, but I have one that will not execute the code with a 0 return code. I know all about the other nonzero codes and am handling everything except and 8 and 16. The files are being copied, the log shows no issues (no fails) but the error code returned is an 8.

Whether I run this command directly from cmdline or through my bat file, the files are copied properly. I have no idea what could be causing a return code of 8 and I definitely don't want to ignore that error code.

I have looked for permission issues, files in use, etc. but haven't found a reason for the bad return code.

Has anyone else seeen this issue or have any advice for me?

Thanks in advance for your help.

Kim
Scott Murray-240410
Scott Murray-240410
Old Hand
Old Hand (397 reputation)Old Hand (397 reputation)Old Hand (397 reputation)Old Hand (397 reputation)Old Hand (397 reputation)Old Hand (397 reputation)Old Hand (397 reputation)Old Hand (397 reputation)

Group: General Forum Members
Points: 397 Visits: 3116
You might want to try using powershell to complete the copy and examine the exit codes
jasona.work
jasona.work
SSCarpal Tunnel
SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)

Group: General Forum Members
Points: 4073 Visits: 11749
The first thing I would do, on the problem system, is set Robocopy to keep a log file (/LOG:{Path and filename}) and review this. Looking over a document I have, code 8 indicates "Some files or directories could not be copied." I think the word "some" is going to be the important one.

Maybe there's a "hidden" file or folder that your batch is failing to copy.

Although, I just re-read your post, saw that you are logging your copies and not seeing any errors.

Maybe try pointing both your SQL backup and batch file to a different folder on the server? I've seen some weird permissions issues in the past where everything looks good, but the user would still get errors.

Jason
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search