Skip to content

Instantly share code, notes, and snippets.

@blitzcode
Created December 29, 2013 22:55
Show Gist options
  • Save blitzcode/8175735 to your computer and use it in GitHub Desktop.
Save blitzcode/8175735 to your computer and use it in GitHub Desktop.
Git RSync Backup Post Commit Hook
#!/bin/sh
if [ -d "/Volumes/Backup SD" ]; then
echo "rsync backup of .git to SD card..."
rsync $GIT_DIR --delete --times --recursive --checksum --compress --human-readable --stats /Volumes/Backup\ SD/
else
echo "SD card 'Backup SD' not inserted, NOT doing the rsync backup"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment