#!/bin/bash TARGET="$1" TARGETDIR="$2" if [[ -z ${TARGET} ]] then echo "No target ip or adress given." exit 1 fi if [[ -z ${TARGETDIR} ]] then echo "No TARGETDIR (\$2) given. Using default '/var/www/magellan-mirror'!" TARGETDIR=/var/www/magellan-mirror fi # sync all rsync \ --recursive \ --times \ --verbose \ --rsh=ssh \ --delete \ /home/cvsd \ ${TARGET}:${TARGETDIR}/ # fix permissions ssh ${TARGET} chmod -R a+rX,go-w ${TARGETDIR}