X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fhomedir%2Fsyncdd.sh;h=745130cffb7200490d648590a655d0539daac8e2;hb=e3d6a4b843d252d07cdf401aa7d68d0d8a06281a;hp=43219716b4487f00f62187b66f19810d4384bf42;hpb=2db23ca1db6661d55b82a75bbd5aeeef60e9b429;p=dak.git diff --git a/config/homedir/syncdd.sh b/config/homedir/syncdd.sh index 43219716..745130cf 100755 --- a/config/homedir/syncdd.sh +++ b/config/homedir/syncdd.sh @@ -26,6 +26,43 @@ export LC_ALL=C export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars . $SCRIPTVARS +EXTRA="" + +check_commandline() { + while [ $# -gt 0 ]; do + case "$1" in + sync) + EXTRA="--exclude ftp/" + ;; + pool) + ;; + *) + echo "Unknown option ${1} ignored" + ;; + esac + shift # Check next set of parameters. + done +} + +if [ $# -gt 0 ]; then + ORIGINAL_COMMAND=$* +else + ORIGINAL_COMMAND="" +fi + +SSH_ORIGINAL_COMMAND=${SSH_ORIGINAL_COMMAND:-""} +if [ -n "${SSH_ORIGINAL_COMMAND}" ]; then + set "nothing" "${SSH_ORIGINAL_COMMAND}" + shift + check_commandline $* +fi + +if [ -n "${ORIGINAL_COMMAND}" ]; then + set ${ORIGINAL_COMMAND} + check_commandline $* +fi + + cleanup() { rm -f "${HOME}/sync.lock" } @@ -40,11 +77,12 @@ if lockfile -r3 ${HOME}/sync.lock; then rsync -aH -B8192 \ --exclude backup/*.xz \ --exclude backup/dump* \ - --exclude ftp/ \ - --exclude mirror/ \ + ${EXTRA} \ + --exclude mirror \ --exclude morgue/ \ --exclude=lost+found/ \ --exclude .da-backup.trace \ + --exclude lock/stages/ \ --delete \ --delete-after \ --timeout 3600 \ @@ -52,7 +90,7 @@ if lockfile -r3 ${HOME}/sync.lock; then ftpmaster-sync:/srv/ftp-master.debian.org/ . cd $public/ - rsync -avH -B8192 \ + rsync -aH -B8192 \ --exclude mirror \ --exclude rsync/ \ --exclude=lost+found/ \