Skip to content

Instantly share code, notes, and snippets.

@Kasahs
Last active August 29, 2015 14:06
Show Gist options
  • Save Kasahs/b1cbf668306a14640f41 to your computer and use it in GitHub Desktop.
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
#!/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