How can I deploy from bamboo to remote server using rsync?
Asked by Luis Pizarro:

When we do deploys to remote servers Bamboo seems to only be able to ant scp the WAR files which takes a very very long time. This could be done manually with rsync but defeats the purpose of using Bamboo. Is there a way or hidden plugin (I've looked) to do this using rsync or some other way of copying the files faster?

Can Maven help somehow for this? We deploy to Glassfish servers


Answers:
author: Volodymyr Krupach
body: I use command native scp via script tasks. For sure you need to run under linux. Please take a look: <https://confluence.atlassian.com/display/BAMBOO/Script>

comments: author: Luis Pizarro
body: thanks we do too but our application is about 1G and copying this over the cable is dramatically slow. I would prefer rsync or some other way that would make the copying faster.


author: Alan Snow
body: @GEETHA PRABHAKARAN  
Is this still possible if you do not have Bamboo installed in house but running from the Atlassian website? Because I'm not aware of a way to SSH into the bamboo server so I can generate the keys. Im currently stuck on deployment with rsync because I have no way to authenticate into the remote server from running the script on the bamboo machine.


author: GEETHAP
body: Yes rsync is better than scp.The data transfer is faster in rsync than scp.Please find the attached screen shots that was broken

<br />

[](https://community.atlassian.com/t5/Bamboo-questions/How-can-I-deploy-from-bamboo-to-remote-server-using-rsync/qaq-p/338356?attachment-id=4373){#link_116901d2574156}  
[](/tnckb94959/attachments/tnckb94959/bamboo-questions/10699/1/Screen%20Shot%202015-02-27%20at%206.04.12%20PM.png){#display_116901d2574156_0}  
[](https://community.atlassian.com/t5/Bamboo-questions/How-can-I-deploy-from-bamboo-to-remote-server-using-rsync/qaq-p/338356?attachment-id=4374){#link_116901d2574156_0}  
[](/tnckb94959/attachments/tnckb94959/bamboo-questions/10699/2/new.png){#display_116901d2574156_2}


author: GEETHAP
body: To deploy using rsync command from bamboo to the remote server

Step 1 : Create ssh keys in local server  

|--------------|
| `ssh-keygen` |

Step 2 : Copy the public key to the remote server  

|---------------------------------------------------------------------------|
| `ssh-copy-id -i ~/.ssh/id_rsa.pub geetha.prabhakaran``@192``.168.``4.121` |

Step 3 :Goto the deployment project -\> Edit environment -\> Add task -\> Script task

Add the following in the script body  

|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `#!/bin/bash` `rsync -avh --delete -e ``"ssh -i $HOME/.ssh/id_rsa"` `otp-analyst-client geetha.prabhakaran``@192``.168.``4.121``:/Network/Servers/`[ldap-nj.addteq.com/Users/geetha.prabhakaran/Desktop](http://ldap-nj.addteq.com/Users/geetha.prabhakaran/Desktop) |

![](https://nebula.addteq.com/download/attachments/99354685/Screen%20Shot%202015-02-27%20at%202.43.58%20PM.png?version=1&modificationDate=1425066295000&api=v2)

Step 4: If the deployment is success,you will get the log as below and can validate by traversing to the corresponding path

![](https://nebula.addteq.com/download/attachments/99354685/jira-capture-screenshot-20150227-144254-270.png?version=1&modificationDate=1425066295000&api=v2)  

comments: author: Luis Pizarro
body: Hi @GEETHA PRABHAKARAN thanks for the comments. The images that you attached are broken for me here. Also, I want to give you a small overview of our set up. We have Bamboo installed in-house. Our builder. We also have remote agents (sitting in clients site) which get a copy of built project (war files) from Bamboo sitting in-house and streams it to the application server. Our problem is when the remote agent gets the copy from Bamboo. It is currently an ant task using scp which is our bottleneck with \~1Gb worth of data transfer. Would your approach help us over come this problem and let us use rsync? Thank you very much in advance. :)


Tags: bamboo-administration