Skip to content

Instantly share code, notes, and snippets.

@vongrippen
Created March 15, 2011 14:34
Show Gist options
  • Save vongrippen/870781 to your computer and use it in GitHub Desktop.
Save vongrippen/870781 to your computer and use it in GitHub Desktop.
rsync-data.sh
#!/bin/bash
if [ -e /tmp/rsync-data-lock ]
then
exit 1
fi
touch /tmp/rsync-data-lock
REMOTE_SERVER=$1
EXCLUDE=$2
rsync -aHAXESz --delete --exclude="$EXCLUDE" /home/ -e "ssh -i /root/.ssh/id_rsa" root@$REMOTE_SERVER:/home
rm /tmp/rsync-data-lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment