Linux3

From SourceWiki
Revision as of 12:26, 1 March 2010 by GethinWilliams (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

More Advanced Examples

Introduction

rsync

#!/bin/bash

# set up some env vars
RSYNC=/usr/bin/rsync
REMOTE_HOST="full.domain.name.here"

# see the rsync man page for an explanation of these
OPTS='-vzrltp --progress --stats --rsh=/usr/bin/ssh --delete --exclude ".svn" --exclude "*~"'

LOCAL_SVN_CHECKOUT=/path/to/my/svn/dir
REMOTE_SRC_DIR=/path/to/my/src/on/remote/machine

# call rsync to _push_ you files to the remote host
$RSYNC $OPTS $LOCAL_SVN_CHECKOUT $REMOTE_HOST:$REMOTE_SRC_DIR

exit 0