#!/bin/sh
#
#  FTPmirror -- update /cs/ftp/icon from /cs/www/icon/ftp
#
#  Run nightly from Gregg's crontab.  Can also be run manually at any time.

SRC=/cs/www/icon/ftp
DST=/cs/ftp/icon

exec 2>&1	# fold stderr into stdout

#  Check for top-level deletions, but do not process automatically.
for FILE in `ls $DST`; do
   test -r $SRC/$FILE || echo "need to delete manually: $DST/$FILE"
   done

#  Transfer files using rdist (to same host)
for FILE in `ls $SRC`; do
   rdist -R -y -c $SRC/$FILE localhost:$DST/$FILE | sed '
	/^localhost: updating host localhost$/d
	/^localhost: updating of localhost finished$/d
'
   done
