Rsync will definitely solve your problem. If you run rsync using -e "ssh <ssh params>"
then it will run via an ssh connection, and under the hood, what rsync does, is it (locally) generates the file list and the delta for each of the files in that list, before comparing it against a remotely generated list, and sending files. It means even on a fast connection, it can be slow to get started, but once it's going it's quick.
I believe there is a windows cli version of rsync and ssh, if not you may want to try installing cygwin with bash/rsync/ssh. It's not a big install if you don't want much. The trick with rsync is getting the right options for what you want.
So in your example, you have stagingserver.local
and remoteserver.local
. Lets say your access to remoteserver is as user releaseuser
. Firstly ensure you can ssh to [email protected]
using putty (I suggest you setup ~releaseuser/.ssh/authorized_keys on remoteserver.local to permit you login as releaseuser using the public version of a local ssh key localkey.pub
, you can set that up by creating a private key in putty-keygen and saving a openssh private/public keys as localkey
and localkey.pub
, then upload the public one to remoteserver.local
).
Ok, so to rsync the local directory localdirectory
to the remote remotedirectory
, using the above:-
rsync -rave "ssh -i localkey" localdirectory/ [email protected]:/remotedirectory/
The trailing slash on each of the directory names, tells it to copy the contents of localdirectory
to the directory remotedirectory
rather than copy the directory itself. If you miss the trailing slash, you'll get remotedirectory/localdirectory
created on the remote server
So to explain a little the options I used there were -rave
(which I always find easy to remember). The -r
means recursive, so descend into directories. The -a
means archive, which is the same as -rlptgoD
, which means basically send everything (links, permissions, times, groups, owners, Devices, but not hard-links, acls or xattrs). -v
means verbose, so echo to screen what it's sending and -e specifies the rsh
command (in our case ssh -i
, which tells ssh which key file to use).
Hope that helps