Skip to content

Instantly share code, notes, and snippets.

@bakineggs
Created August 19, 2009 20:54
Show Gist options
  • Select an option

  • Save bakineggs/170644 to your computer and use it in GitHub Desktop.

Select an option

Save bakineggs/170644 to your computer and use it in GitHub Desktop.
#!/bin/sh
LOCAL_DIRECTORY='/Users/dan/backups/bakineggs.com'
REMOTE='lwweb:/www/bakineggs.com/'
if [ ! -d $LOCAL_DIRECTORY ]; then
mkdir -p $LOCAL_DIRECTORY
fi
cd $LOCAL_DIRECTORY
if [ ! -d '.git' ]; then
git init
fi
rsync -az --delete-before --exclude='.git' $REMOTE .
git add .
git commit -m "`date`"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment