开发者

cruise control .net : xcopy not working for copying files to remote server

I am trying to copy a folder to a remote machine using xcopy. This command is executed via cruise control task. I can run xcopy source destOnRemoteMachine successfully if i am running it from command prompt. But if i am executing it from cruise control .net, it is always complaining about "Invalid drive specification" error.

I tried :

> <exec
> executable="c:\Windows\System32\xcopy.exe">
>                 <baseDirectory>$(BASE)\Project</baseDirectory>
>                 <buildArgs>.\*.* RemoteMachine\Project /Y</buildArgs>
>                 <buildTimeoutSeconds>10</buildTimeoutSeconds>
>                 <successExitCodes>-1,0,1</successExitCodes>
>               </exec>

and :

<exec executable="c:\Windows\System32\cmd.exe">
        <baseDirectory>$(BASE)\Project</baseDirectory>
        <buildArgs>/C xcopy $(BASE)\Project\*.* RemoteMachine /y</buildArgs>
        <buildTimeoutSeconds>30</buildTimeoutSeconds>
        <successExitCodes>-1,0,1</successExitCodes>
      </exec>

Any Suggest开发者_开发技巧ions?


thanks for your answer. Putting xcopy in batch was also not helpful, the problem was something else. here is problem:

It was problem with the account on which Cruise Control .net service was running. It was running as local service. Thus was not able to see the network path. I changed CCNet Service to run on a domain account which have permission to read/ write on remote machine. This solved my problem.

Thanks.


Create a batch file using xcopy source destOnRemoteMachine command and execute that bat file using <exec> command in cruise control .net


In my case I was running CC as a user account, after having used NET USE to persistently map a drive letter to a network share on another domain. Although it worked in a desktop session, CC could still not get to the share as part of the build. Executing NET USE as part of the build (without a drive mapping) allowed the copy to succeed.

<exec program="net" verbose="true">
  <arg value="use" />
  <arg value="\\server\share" />
  <arg value="password" />
  <arg value="/user:domain\username" />
</exec>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜