Skip to content

Instantly share code, notes, and snippets.

@pmig
Created May 22, 2014 22:07
Show Gist options
  • Select an option

  • Save pmig/b88efca2fa54a6901cdc to your computer and use it in GitHub Desktop.

Select an option

Save pmig/b88efca2fa54a6901cdc to your computer and use it in GitHub Desktop.
#!/bin/zsh
# pmig.at
# this skript uses zsh + .oh-my-zsh shortcuts (check them out - they are awesome anyway)
usage () {
echo "USE IT:"
echo "zsh auto-rsync LOCALFOLDER REMOTE PATH"
echo "e.g. \"zsh auto-rsync test me@mytestsever:parentfortest\""
exit
}
if [ -z "$1" ] || [ -z "$2" ]; then
usage
fi
AR_homefolder=$1
AR_remotefolder=$2
while (true) {
rsync -azvv --exclude='.*' -e ssh $AR_homefolder $AR_remotefolder
sleep 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment