Linux3

More Advanced Examples =Introduction=

=rsync=


 * 1) !/bin/bash


 * 1) An rsync script to, for example, synchronise an SVN checkout on your local machine
 * 2) with a copy of your checkout, kept on a remote machine.  The files are transported
 * 3) via SSH, so all the usual comments about using SSH keys etc. apply

RSYNC=/usr/bin/rsync REMOTE_HOST="full.domain.name.here" REMOTE_USER_NAME="known-as"
 * 1) set up some env vars

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

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

$RSYNC $OPTS $LOCAL_SVN_CHECKOUT $REMOTE_USER_NAME@$REMOTE_HOST:$REMOTE_SRC_DIR
 * 1) call rsync to PUSH your files to the remote host

exit 0