Skip to content

Instantly share code, notes, and snippets.

@msadouni
Created March 9, 2012 15:06
Show Gist options
  • Save msadouni/2006892 to your computer and use it in GitHub Desktop.
Save msadouni/2006892 to your computer and use it in GitHub Desktop.
Sync a folder via rsync / ssh
#!/bin/bash
export_to='/path/to/export/without/slash'
login='login'
server='server.com'
root='/path/to/app/without/slash'
rm -rf $export_to
git checkout-index -a --prefix=$export_to/
rsync -avz -e ssh $export_to/ $login@$server:$root --exclude-from 'exclude.rsync'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment