Created
April 11, 2011 10:06
-
-
Save alotaiba/913313 to your computer and use it in GitHub Desktop.
Using rsync to sync files to an Amazon EC2 instance using SSH key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rsync -avz /path/to/local/sync/folder -e "ssh -i /path/to/ssh/key" ubuntu@ec2instance:/path/to/remote/sync/folder |
Works great but only seems to go one direction. If I delete a file/folder from the initial /path/to/local/sync/folder that change doesn't propagate to the ec2 instance(s). If I ADD a file it syncs over just fine, how can I adjust this so that deletes carry over as well?
You probably figured this out already, but if not I think you just add --delete after the -avz so:
rsync -avz --delete /path/to/local/sync/folder -e "ssh -i /path/to/ssh/key" ubuntu@ec2instance:/path/to/remote/sync/folder
unison is a good option. It is bidirectional and provides options how to handle conflicts.
how rsync works from Ubuntu to Windows server scenario ?
rsync -avz /tmp/* [email protected]:/cygdrive/c/
Above command is not working
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!