snaprep

git mirror of https://ccx.te2000.cz/bzr/snaprep
git clone https://ccx.te2000.cz/git/snaprep
Log | Files | Refs

commit 44398161910ed074bc3f42f03be2e52e29db9596
parent c45e6664f59a411e1fce91dc32b4e45259ca3865
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date:   Fri, 21 Feb 2014 00:36:38 +0100

test it locally
Diffstat:
Mbin/snap.list | 2+-
Mbin/snap.push | 3++-
Mbin/snap.push.single | 5+++--
3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/bin/snap.list b/bin/snap.list @@ -1,3 +1,3 @@ #!/bin/sh -rsync -li --include='.snapshot.[0-9]*' --exclude='*' "$@" | \ +rsync -li --include='.snapshot.[0-9]*' --exclude='*' $RSYNC_ARGS "$@" | \ awk '$5 ~ /^\.snapshot\./{ print substr($5, 11) }' diff --git a/bin/snap.push b/bin/snap.push @@ -2,7 +2,7 @@ : ${SNAP_SRCS:=.} usage() { - printf >&2 "Usage: %s: [-S SNAP_SRCS] [-D SNAP_DST] [-] [RSYNC_ARGS]\n" $(basenam "$0") + printf >&2 "Usage: %s: [-S SNAP_SRCS] [-D SNAP_DST] [-] [RSYNC_ARGS]\n" $(basename "$0") exit 2 } @@ -19,6 +19,7 @@ while getopts S:D: opt; do (h) usage;; esac done +shift $(($OPTIND - 1)) case $1 in (-) shift;; diff --git a/bin/snap.push.single b/bin/snap.push.single @@ -19,6 +19,7 @@ while getopts S:D: opt; do (h) usage;; esac done +shift $(($OPTIND - 1)) case $1 in (-) shift;; @@ -50,7 +51,7 @@ check_remote() { } rs() { - rsync -aA --delete + rsync -aA --delete $RSYNC_ARGS "$@" } push_remote() { @@ -72,7 +73,7 @@ push_local() { else rs "$@" "$SNAP_SRC/" "$SNAP_DST/$ts/" || exit $? fi - touch "${SNAP_DST}/${marks##*/}" + touch "${SNAP_DST}/${mark##*/}" } case "$SNAP_SRC" in