Robocopy false error code of 8 when executed from SQL

  • 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

  • You might want to try using powershell to complete the copy and examine the exit codes

  • 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

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply