sam
sam

Reputation: 4684

Creating a folder on a remote server using batch file from teamcity build agent

I am trying to create a folder on a remote machine by running the batch file from teamcity and then copy source into that folder but it seems to be not doing. Using following code to create and copy

SET dirTempBackup=\\server1\BackupStorage\temp\test
SET Current=\\server1\web\BuildEnvironment\test

 ECHO Starting to copy files.
 IF NOT EXIST "%dirTempBackup%" MKDIR "%dirTempBackup%"
 IF NOT EXIST "!Current!" (
ECHO ERROR! Not found: !Current!
 ) ELSE (
ECHO Copying: !Current!
SET Destination=%dirTempBackup%\!Current:~0,1!
REM Directory.
XCOPY "!Current!" "!Destination!" /v /c /i /g /h /q /r /y /e
)

using the temp directory as compressing it later and then deleeting it at the end. Teamcity is generating Access is denied. and Copy failing due to Invalid path. Have checked teamcity user has full rights on that folder.

Upvotes: 2

Views: 10420

Answers (1)

sam
sam

Reputation: 4684

checking the permissions on both source and destination fixed the problem.

Upvotes: 2

Related Questions