Search code examples
linuxunixubunturemote-debugging

What linux command will sync files betwen localhost and remote server?


I have a quick question, I'm developing an application, on my computer and often send newly created code to the remote server on AWS.

right now I'm using this command:

scp -i ~xxx.pem -r manager/ ubuntu@xxxxxxxxxxx-amazonaws.com:

And every time I launch it, it overrides the previous files, which is good. But what I would like to have is something that will work kinda like an rsync. Means it will not copy files that didn't change.

My other thought was to use git or svn to accomplish this, but I'm not sure if it is the right way.

So the question is how to sync files between localhost and remote server in the most "cheap" way (without uploading the same staff over and over again)


Solution

  • If you want to sync files, you should not be using scp (copy).

    I think these documents might help you:

    Basically they talks about how to use rsync over the ssh protocol.