diff options
author | Malf Furious <m@lfurio.us> | 2017-09-13 22:48:26 -0400 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2017-09-13 22:48:26 -0400 |
commit | be5ecf8e81e1457e8532558948a7d380bfaab3c4 (patch) | |
tree | 379ee5a847ec97a32813117d6e2004739c4b1d49 /rsync.sh | |
parent | b4acf0ac3704124bbb76528beea5656c0239d1cb (diff) | |
download | systrunk-be5ecf8e81e1457e8532558948a7d380bfaab3c4.tar.gz systrunk-be5ecf8e81e1457e8532558948a7d380bfaab3c4.zip |
Add clone op
Diffstat (limited to 'rsync.sh')
-rw-r--r-- | rsync.sh | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -105,3 +105,25 @@ function systr_rsync_merge rsync -azb --suffix='*' --exclude='*.systr' \ "$src" "$dst" } + +## +# systrunk clone <source> <destination> +# +# 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" +} |