Skip to content

Instantly share code, notes, and snippets.

@joshholt
Created January 19, 2012 17:12
Show Gist options
  • Save joshholt/1641247 to your computer and use it in GitHub Desktop.
Save joshholt/1641247 to your computer and use it in GitHub Desktop.
Bash Function to sync directories
#------------------------------------------------
# $1 should be the local dir you want to sync
# $2 should be the remote server path (i.e. user@remote:~/)
#------------------------------------------------
function rsync_dir () {
rsync --verbose --progress --stats --compress --rsh=/usr/bin/ssh --recursive --times --perms --links --delete --exclude "*bak" --exclude "*~" $1 $2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment