File From One Server To Another

I have Solaris server A(1.1.22.233) AND Solaris server B(1.1.22.234)

I need to connect to server A and,copy one file from server A to server B using shell script.
I need to automate .How can i do this.Script will be deployed in server A.

You can use sftp/scp as long as you have an ssh-key exchanged