diff options
-rw-r--r-- | scripts/rsync-mirror | 23 |
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 |