diff options
author | Milo Casagramde <milo.casagrande@linaro.org> | 2013-03-04 08:32:26 +0000 |
---|---|---|
committer | Milo Casagramde <milo.casagrande@linaro.org> | 2013-03-04 08:32:26 +0000 |
commit | 1f714019b3e733efef8a00d266fdd20f4439d535 (patch) | |
tree | 0e189e66acc681386d0d85f7813f9a2a254da638 | |
parent | b7fe949ffbbbc7aa507053f67fded0cfe77a9290 (diff) |
Added first simple bash rsync script.
-rw-r--r-- | scripts/rsync-mirror | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/rsync-mirror b/scripts/rsync-mirror new file mode 100644 index 0000000..bfcd5bd --- /dev/null +++ b/scripts/rsync-mirror @@ -0,0 +1,15 @@ +#!/bin/bash + +SSH_USER="linaro-rsync" +GIT_SERVER=git.linaro.org +PRIVATE_REPO_PATH="/srv/linaro-private.git.linaro.org/git/" +PUBLIC_REPO_PATH="/srv/git.linaro.org/git/" +LOCAL_REPO_PATH="/opt/rhodecode/git_repos" +PRIVATE_LOCAL_PATH=$LOCAL_REPO_PATH/private + +# Sync private repositories, following symlinks and deleting locally. +rsync -e "ssh -l $SSH_USER" -r -L -z --compress-level=8 --delete $SSH_USER@$GIT_SERVER:$PRIVATE_REPO_PATH $PRIVATE_LOCAL_PATH + +# Syncs normal repositories, following symlinks and deleting locally. +rsync -e "ssh -l $SSH_USER" -r -L -z --compress-level=8 --delete $SSH_USER@$GIT_SERVER:$PUBLIC_REPO_PATH $LOCAL_REPO_PATH + |