=== removed file 'bin/snap.rsync.post' --- bin/snap.rsync.post 2014-02-19 02:28:06 +0000 +++ bin/snap.rsync.post 1970-01-01 00:00:00 +0000 @@ -1,30 +0,0 @@ -#!/bin/sh -exec 1>&2 -env | grep RSYNC | sort | tr '\n' '\t'; echo - -set -x - -case $RSYNC_MODULE_NAME in - (*.push) ;; - (*) exit 1;; -esac - -for m in $RSYNC_MODULE_PATH/.snapshot.[0-9]*; do - test -f "$m" || continue - test -n "$mark" && exit 1 - mark=$m -done - -test -f "$mark" || exit 1 - -snap_dir=${RSYNC_MODULE_PATH%/*} - -if test -f "$snap_dir/${mark##*/}"; then - # already have this snapshot - rm -f "$mark" - exit $? -fi - -ts=${mark##*.} -rsync -aA --exclude=/.snapshot.\* --link-dest="$RSYNC_MODULE_PATH/" "$RSYNC_MODULE_PATH/" "$snap_dir/$ts/" || exit $? -mv "$mark" "$snap_dir/" || exit $? === renamed file 'bin/snap.rsync.post.zsh' => 'bin/snap.rsync.post' === modified file 'bin/snap.rsync.pre' --- bin/snap.rsync.pre 2014-02-19 02:28:06 +0000 +++ bin/snap.rsync.pre 2014-02-18 13:43:24 +0000 @@ -1,25 +1,9 @@ -#!/bin/sh -exec 1>&2 -env | grep RSYNC | sort | tr '\n' '\t'; echo +#!/bin/zsh +env | grep RSYNC 1>&2 set -x - -case $RSYNC_MODULE_NAME in - (*.push) ;; - (*) exit 1;; -esac - -for m in $RSYNC_MODULE_PATH/.snapshot.[0-9]*; do - test -f "$m" || continue - if test -n "$erase"; then - rm -f "$m" || exit $? - elif test -n "$mark"; then - rm -f "$m" "$mark" || exit $? - erase=1 - fi - mark=$m -done - -test -n "$erase" && exit 0 - -test -f "$mark" && snap.rsync.post -exit 0 +# mkdir -p /tmp/snaprep/new || exit $? + +[[ $RSYNC_MODULE_NAME != 'snaprep_new' ]] && exit 0 + +f=( $RSYNC_MODULE_PATH/.snapshot.[0-9]*(N) ) +if (($#f)); then $0:h/post; fi === modified file 'rsyncd.conf' --- rsyncd.conf 2014-02-19 02:28:06 +0000 +++ rsyncd.conf 2014-02-18 09:54:08 +0000 @@ -20,10 +20,10 @@ path = /tmp/snaprep read only = yes -[snaprep.push] +[snaprep_new] path = /tmp/snaprep/new read only = no write only = yes refuse options = inplace - pre-xfer exec = /home/ccx/bzr/snaprep/bin/snap.rsync.pre - post-xfer exec = /home/ccx/bzr/snaprep/bin/snap.rsync.post + pre-xfer exec = /home/ccx/bzr/snaprep/pre + post-xfer exec = /home/ccx/bzr/snaprep/post