=== modified file 'bin/snap.marked' --- bin/snap.marked 2014-11-05 00:39:57 +0000 +++ bin/snap.marked 2014-08-12 17:06:09 +0000 @@ -14,17 +14,15 @@ test $# -gt 1 || usage SNAP_SRC="$1" -: ${SNAP_WRITESRC:=$SNAP_SRC} -export SNAP_SRC SNAP_WRITESRC +export SNAP_SRC shift test -d "$SNAP_SRC" || die "not a directory: $SNAP_SRC" -test -d "$SNAP_WRITESRC" || die "not a directory: $SNAP_WRITESRC" -LOCKFILE="$SNAP_WRITESRC/.snaprep" +LOCKFILE="$SNAP_SRC/.snaprep" touch "$LOCKFILE" || exit $? flock -n 0 <"$LOCKFILE" || exit $? echo $$ >"$LOCKFILE" || exit $? -rm -f "$SNAP_WRITESRC"/.snapshot.[0-9]* 2>/dev/null -mark="$SNAP_WRITESRC/.snapshot.$(date +%s)" +rm -f "$SNAP_SRC"/.snapshot.[0-9]* 2>/dev/null +mark="$SNAP_SRC/.snapshot.$(date +%s)" touch "$mark" || exit $? "$@" === modified file 'bin/snap.push.single' --- bin/snap.push.single 2014-11-05 00:39:57 +0000 +++ bin/snap.push.single 2014-08-12 16:36:47 +0000 @@ -31,10 +31,8 @@ usage fi -: ${SNAP_WRITESRC:=$SNAP_SRC} - check_local() { - for m in $SNAP_WRITESRC/.snapshot.[0-9]*; do + for m in $SNAP_SRC/.snapshot.[0-9]*; do test -f "$m" || continue test -n "$mark" && die "duplicate snapshot mark" mark=$m @@ -62,8 +60,8 @@ (*.push) ;; (*) SNAP_DST=${SNAP_DST}.push;; esac - rs "$@" --exclude=/${mark##*/} "$SNAP_SRC/" "$SNAP_DST/" && \ - rs "$@" "$SNAP_WRITESRC/${mark##*/}" "$SNAP_DST/" + rs "$@" --exclude=/.snapshot.\* "$SNAP_SRC/" "$SNAP_DST/" && \ + rs "$@" "$SNAP_SRC/" "$SNAP_DST/" } push_local() {