rsync (Pete's notes)
To install rsync on Linux, I did
rpm -i rsync-2.5.0-1.i386.rpm
This installs it fine, but to it to copy files to a remote
machine, rsync has to be installed on the remote machine.
If it's not installed on the remote machine, you'll get a cryptic
error like
$ rsync -e ssh ben.txt netserver:
bash: rsync: command not found
rsync: connection unexpectedly closed (0 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at io.c(139)
okapi$
To install rsync on Solaris, I did
ftp gate.ucar.edu
anonymous@rsync.samba.org
cd pub/rsync
binary
get rsync-2.5.1.tar.gz
quit
gunzip rsync-2.5.1.tar.gz
tar xf rsync-2.5.1.tar
rm rsync-2.5.1.tar
cd rsync-2.5.1
./configure
make
make install
make clean
Now you can do, like,
rsync -e ssh ben.txt netserver:
For convenience, you can set an environment variable so that you
don't have to use the "-e" command-line option. Add this to the
.bashrc file:
#
# Set up rsync
#
if [[ ${HOST} = 'okapi' || ${HOST} = 'netserver' ]]; then
if [ $DEBUGGING ]; then
echo ".bashrc: setting up rsync..."
fi
export RSYNC_RSH=ssh
fi
To copy my personal web from okapi to netserver, do this on okapi:
rsync \
--delete \
--update \
--verbose \
--recursive \
--exclude "*~" \
--exclude "/internal/" \
--exclude "/old/" \
/usr/web/nets/intro/staff/siemsen/ \
netserver:/usr/web/nets/intro/staff/siemsen
To copy the entire NETS web from netserver to okapi, do this on
the target machine. Note that you don't have to worry about
overwriting my personal web, as this copy excludes all the staff
pages.
rsync \
--delete \
--update \
--verbose \
--recursive \
--exclude "*~" \
--exclude "/RemedyMacros/" \
--exclude "/internal/archives/" \
--exclude "/cgi/Cricket" \
--exclude "/intro/staff/" \
--exclude "/docs/photos/" \
--exclude "/datacomm" \
--exclude "/internal/CAD_DRAWINGS" \
--exclude "/internal/portlists/vlan*" \
--exclude "/linkdoc" \
--exclude "/stats" \
--exclude "/projects/Westnet" \
netserver:/usr/web/nets/ \
/usr/web/nets
Pete Siemse
Last modified: Wed Jun 21 12:59:14 MDT 2006