Command Line Build Step - Rsync Stuck
I'm using TeamCity to deploy some code files to a SiteGround website. My preferred way of doing this is to make use of rsync.
I've been able to run a successful rsync command directly on the server and have transferred files just fine. However, when I try to do the same in TeamCity using the "Command Line" runner type, it just hangs. I've added `-vv` and `--progress` which has given me a little bit more information but it just seems to sit spinning.
Here's the command I'm running:
```
rsync -avvz --progress --exclude-from='exclude.txt' -e 'ssh -p 1234 -i "C:\key_path"' local_folder/ username@host:/home/username/www/website_name/public_html/
```
When that runs, I get the following output:
```
Step 1/1: Command Line
Content of C:\TeamCity\buildAgent\temp\agentTmp\custom_script3540432755549071709.cmd file:
@echo off
rem This is a custom script written by TeamCity using windows-1252 charset.
rsync -avvz --progress --exclude-from='exclude.txt' -e 'ssh -p 1234 -i "C:\key_path"' local_folder/ username@host:/home/username/www/website_name/public_html/
Starting: C:\TeamCity\buildAgent\temp\agentTmp\custom_script3540432755549071709.cmd
in directory: C:\TeamCity\buildAgent\work\b0e622b4a054b513
opening connection using: ssh -p 1234 -i "C:\key_path" -l username host rsync --server -vvlogDtprze.iLs . /home/username/www/website_name/public_html/
```
This shows during the build step in TeamCity but then nothing happens. No files have transferred to the server at all. As mentioned above, this works absolutely fine from the server - I've even tried running it from the .cmd file that TeamCity created and there are no problems whatsoever.
Here's some things I've checked:
1. I can run the command on the server in cmd.exe
1. I can run the command using the .cmd file that TeamCity creates
1. I left the script to run in case it was taking a while but it never completes
1. I've tried using relative paths in the rsync command
1. I've checked that TeamCity is using the same user that I ran the above tests on
Please sign in to leave a comment.