Last active
August 29, 2015 14:06
-
-
Save Kasahs/b1cbf668306a14640f41 to your computer and use it in GitHub Desktop.
automatically rsync local files with EC2 when local directory content changes, using inotifywait
This file contains hidden or 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
#!/bin/sh | |
LOCAL="/path/to/local/dir" | |
while true | |
do | |
inotifywait -r $LOCAL | |
rsync -avL --progress --exclude-from rsync_exclude.list -e "ssh -i /path/to/id_rsa" /path/to/local/dir username@host:~/ | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment