Which Windows user does Jenkins run jobs on?

894 views
Skip to first unread message

ChrisK

unread,
Jun 14, 2013, 3:48:15 PM6/14/13
to jenkins...@googlegroups.com
Hello,

I'm relatively new to Jenkins so bare with me if these question seems elementary. I have done some googling, but haven't be able to come up with anything that works.

I need to perform an xcopy command from our local Jenkins machine to another remote machine. However, to access the remote machine I need to log in with a username and password. So when Jenkins executes the command it says "Invalid drive specification". I have tried the xcopy manually on the Jenkins server and it works fine since I have saved the credentials for the remote machine. It's only when I use Jenkins to perform the xcopy that it fails.

Is there a way to specifically set which windows user Jenkins uses to execute jobs? I have tried changing the "LogOn" settings on the jenkins service and then restarting the service and it did not work. Or any other ways around this?


Here is the command I need to execute: 

xcopy "C:\Program Files (x86)\Jenkins\jobs\SilkTestClassic Git\workspace\zz_Reorg\*" "\\qaserver\AcceptTest\Jenkins\Source\" /c /s /y /i /h 


Here is my console output:

Started by user anonymous
Building on master in workspace C:\Program Files (x86)\Jenkins\jobs\SilkTestClassic Git (qaserver)\workspace
Checkout:workspace / C:\Program Files (x86)\Jenkins\jobs\SilkTestClassic Git (qaserver)\workspace - hudson.remoting.LocalChannel@aee86f
Using strategy: Default
Last Built Revision: Revision 2d67c364f55926e5c1308806210ceba2918ace06 (origin/master)
Fetching changes from 1 remote Git repository
Fetching upstream changes from origin
Commencing build of Revision 2d67c364f55926e5c1308806210ceba2918ace06 (origin/master)
Checking out Revision 2d67c364f55926e5c1308806210ceba2918ace06 (origin/master)
[workspace] $ cmd /c call C:\Users\qatest\AppData\Local\Temp\hudson3277876910276465049.bat

C:\Program Files (x86)\Jenkins\jobs\SilkTestClassic Git (qaserver)\workspace>xcopy "C:\Program Files (x86)\Jenkins\jobs\SilkTestClassic Git\workspace\zz_Reorg\*" "\\qaserver\AcceptTest\Jenkins\Source\" /c /s /y /i /h  
Invalid drive specification
0 File(s) copied

C:\Program Files (x86)\Jenkins\jobs\SilkTestClassic Git (qaserver)\workspace>exit 4 
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE


Thank you!




Hau Vong

unread,
Jun 14, 2013, 3:50:41 PM6/14/13
to jenkins...@googlegroups.com
 is "\\qaserver\AcceptTest\Jenkins\Source\" /c /s /y /i /h  a shared drive? if not, you can add c$, d$, etc depending on the drive letter. 
ex: "\\qaserver\c$\AcceptTest\Jenkins\Source\" /c /s /y /i /h  


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

ChrisK

unread,
Jun 14, 2013, 3:57:12 PM6/14/13
to jenkins...@googlegroups.com
It's a shared folder from another machine.

Hau Vong

unread,
Jun 14, 2013, 4:02:14 PM6/14/13
to jenkins...@googlegroups.com
does the acct, that jenkins service is running under, have permission to the shared drive? 

k.thi...@comcast.net

unread,
Jun 14, 2013, 4:13:18 PM6/14/13
to jenkins...@googlegroups.com
Try changing the service over to running as the local system account.  Then you should be able to add permissions on the share for that entire machine name.


From: "ChrisK" <chri...@caseware.com>
To: jenkins...@googlegroups.com
Sent: Friday, June 14, 2013 2:48:15 PM
Subject: Which Windows user does Jenkins run jobs on?
Reply all
Reply to author
Forward
0 new messages