SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 SQL Agent and robocopy
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Lumbago
Norsk Yak Master

Norway
3271 Posts

Posted - 01/26/2009 :  11:00:51  Show Profile  Reply with Quote
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 Posts

Posted - 01/30/2009 :  05:35:13  Show Profile  Click to see AnisR's MSN Messenger address  Reply with Quote
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

Go to Top of Page

Lumbago
Norsk Yak Master

Norway
3271 Posts

Posted - 01/30/2009 :  05:44:52  Show Profile  Reply with Quote
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
Go to Top of Page

robvolk
Most Valuable Yak

USA
15655 Posts

Posted - 01/30/2009 :  08:13:37  Show Profile  Visit robvolk's Homepage  Reply with Quote
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.
Go to Top of Page

Lumbago
Norsk Yak Master

Norway
3271 Posts

Posted - 01/30/2009 :  08:29:19  Show Profile  Reply with Quote
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000