Skip to content

Instantly share code, notes, and snippets.

@abigoroth
Created June 28, 2018 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abigoroth/d48db712b194c69046e00df6f048401a to your computer and use it in GitHub Desktop.
Save abigoroth/d48db712b194c69046e00df6f048401a to your computer and use it in GitHub Desktop.
hook rsync completion.
SYNC_FILE () {
#check for rsync binary
if [[ -z $(whereis -qb rsync) ]]; then
echo "fatal error: rsync not found."
exit 1
fi
echo "Begin rsync.."
#run rsync to sync with remote server.
rsync -azP --prune-empty-dirs --include="*/" --include="*.slave" --exclude="*" $LOCAL_PATH system@$SERVER:$REMOTE_PATH
echo "Sync done."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment