Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2009-01-26 : 11:00:51
|
Hi,do any of you use robocopy in a job step as a CMD task? I have a job to move backup files to another server using robocopy, but for some strange reason the SQL Server Agent reports "The step failed" whenever some files have been synched and when it doesn't do anything it reports success. Anyone seen this before?- Lumbago |
|
AnisR
Starting Member
1 Post |
Posted - 2009-01-30 : 05:35:13
|
You need to check the SQLAgent service account wether it has the permission to copy to the destination folder and to read from the source folder.You can also use a proxy account for the job and specify a new account to execute the job.quote: Originally posted by Lumbago Hi,do any of you use robocopy in a job step as a CMD task? I have a job to move backup files to another server using robocopy, but for some strange reason the SQL Server Agent reports "The step failed" whenever some files have been synched and when it doesn't do anything it reports success. Anyone seen this before?- Lumbago
|
 |
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2009-01-30 : 05:44:52
|
The job works great and I have specified the correct permissions. The only tweak I had to do was to set this job step to "On failure go to next step" instead of "Quit the job reporting failure". It works 100% but I get this really annoying warning sign for every time some files are actually moved.- Lumbago |
 |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2009-01-30 : 08:13:37
|
I've had the same problem. Robocopy always sets the ERRORLEVEL even if it's successful. Other than setting on failure next step, the only other advice I can think of is to have failure jump to another step that always returns success. The step history will still have an error message, but the job should succeed overall.From what I've heard Windows 7 will have an updated version of Robocopy as the standard copy utility, it might fix this. |
 |
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2009-01-30 : 08:29:19
|
Ok thanx alot Rob, at least I know that I'm not doing anything wrong. Robocopy is just too good a tool to be scratched because of this "small" issue... - Lumbago |
 |
|
|
|
|