aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilo Casagramde <milo.casagrande@linaro.org>2013-03-08 06:36:43 +0000
committerMilo Casagramde <milo.casagrande@linaro.org>2013-03-08 06:36:43 +0000
commitf767f26650326d376091d09f15657c5409344790 (patch)
tree26b09f24735b8b3ac838e086076abf9d83210760
parent0bc756de0d3530e2d3402f867eab2b492f212517 (diff)
Better recursive links handling, correctly handle also delete.
-rw-r--r--scripts/rsync-mirror23
1 files changed, 20 insertions, 3 deletions
diff --git a/scripts/rsync-mirror b/scripts/rsync-mirror
index 5c27c3e..0f30bba 100644
--- a/scripts/rsync-mirror
+++ b/scripts/rsync-mirror
@@ -1,5 +1,22 @@
#!/bin/bash
+# Copyright (C) 2013 Linaro Ltd.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>
+
+# Script to ssh-rsync repositories between machines.
+
RHODECODE_USER=rhodecode
SSH_USER=git-linaro-staging
SSH_KEY=$HOME/.ssh/id_rsa
@@ -25,13 +42,13 @@ fi
# Sync private repositories, following symlinks and deleting locally.
echo "Rsyncing linaro-private repositories..."
-rsync -e "ssh -i $SSH_KEY -l $SSH_USER" -r -L -z -t --compress-level=8 --delete $SSH_USER@$GIT_SERVER:$LINARO_PRIVATE_REMOTE $LINARO_PRIVATE_PATH
+rsync -e "ssh -i $SSH_KEY -l $SSH_USER" -r --copy-unsafe-links -z -t --compress-level=8 --delete $SSH_USER@$GIT_SERVER:$LINARO_PRIVATE_REMOTE $LINARO_PRIVATE_PATH
echo "Rsyncing landing-teams private repositories..."
-rsync -e "ssh -i $SSH_KEY -l $SSH_USER" -r -L -z -t --compress-level=8 --delete $SSH_USER@$GIT_SERVER:$LANDING_TEAMS_REMOTE $LANDING_TEAMS_PATH
+rsync -e "ssh -i $SSH_KEY -l $SSH_USER" -r --copy-unsafe-links -z -t --compress-level=8 --delete $SSH_USER@$GIT_SERVER:$LANDING_TEAMS_REMOTE $LANDING_TEAMS_PATH
# Sync normal repositories, following symlinks and deleting locally.
echo "Rsyncing public repositories..."
-rsync -e "ssh -i $SSH_KEY -l $SSH_USER" -r -L -z -t --compress-level=8 --delete $SSH_USER@$GIT_SERVER:$PUBLIC_REPO_PATH $LOCAL_REPO_PATH
+rsync -e "ssh -i $SSH_KEY -l $SSH_USER" -r --copy-unsafe-links -z -t --compress-level=8 --delete --filter=-r_/private/ $SSH_USER@$GIT_SERVER:$PUBLIC_REPO_PATH $LOCAL_REPO_PATH
echo "Setting directories ownership..."
chown -R $RHODECODE_USER:$RHODECODE_USER $LOCAL_REPO_PATH