From be5ecf8e81e1457e8532558948a7d380bfaab3c4 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Wed, 13 Sep 2017 22:48:26 -0400 Subject: Add clone op --- rsync.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'rsync.sh') diff --git a/rsync.sh b/rsync.sh index 165d360..d94677b 100644 --- a/rsync.sh +++ b/rsync.sh @@ -105,3 +105,25 @@ function systr_rsync_merge rsync -azb --suffix='*' --exclude='*.systr' \ "$src" "$dst" } + +## +# systrunk clone +# +# Recursively create a complete copy of a directory tree +# which, presumabally, contains systrunk repositories. +# This copy preserves all underlying hard-links as to +# preserve the disk space saved by systrunk commit. Note: +# --delete is passed to rsync! +## +function systr_clone +{ + if [ $# -lt 2 ]; then + echo "Fatal: too few args to clone" >&2 + exit 1 + fi + + src="$1" + dst="$2" + + rsync -azH --info=progress2 --info=stats2 --delete "$src" "$dst" +} -- cgit v1.2.3