summaryrefslogtreecommitdiff
path: root/bin/parallel-rsync-repos
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2015-10-05 18:02:12 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2015-10-05 18:02:12 +0200
commit6479b821ebc04d9e2ec69be451768968c06ce6a5 (patch)
tree6da5135086d4f798f717d24504f737dda8eb869d /bin/parallel-rsync-repos
parent4dd7c2f1e0174f8de6be9c57f7296e64e1534af5 (diff)
downloadgitlab-ce-6479b821ebc04d9e2ec69be451768968c06ce6a5.tar.gz
Add RSYNC variable to parallel-rsync-repos
Diffstat (limited to 'bin/parallel-rsync-repos')
-rwxr-xr-x[-rw-r--r--]bin/parallel-rsync-repos15
1 files changed, 14 insertions, 1 deletions
diff --git a/bin/parallel-rsync-repos b/bin/parallel-rsync-repos
index b2429f743b5..b777056c95f 100644..100755
--- a/bin/parallel-rsync-repos
+++ b/bin/parallel-rsync-repos
@@ -4,6 +4,15 @@
# Example invocation:
# find /var/opt/gitlab/git-data/repositories -maxdepth 2 | \
# parallel-rsync-repos /var/opt/gitlab/git-data/repositories /mnt/gitlab/repositories
+#
+# You can also rsync to a remote destination.
+#
+# parallel-rsync-repos /var/opt/gitlab/git-data/repositories user@host:/mnt/gitlab/repositories
+#
+# If you need to pass extra options to rsync, set the RSYNC variable
+#
+# env RSYNC='rsync --rsh="foo bar"' parallel-rsync-repos /src dest
+#
SRC=$1
DEST=$2
@@ -17,10 +26,14 @@ if [ -z "$SRC" ] || [ -z "$DEST" ] ; then
exit 1
fi
+if [ -z "$RSYNC" ] ; then
+ RSYNC=rsync
+fi
+
if ! cd $SRC ; then
echo "cd $SRC failed"
exit 1
fi
sed "s|$SRC|./|" |\
- parallel -j$JOBS --progress "mkdir -p $DEST/{} && rsync --delete -a {}/. $DEST/{}/"
+ parallel -j$JOBS --progress "mkdir -p $DEST/{} && $RSYNC --delete -a {}/. $DEST/{}/"