aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilo Casagramde <milo.casagrande@linaro.org>2013-03-04 08:32:26 +0000
committerMilo Casagramde <milo.casagrande@linaro.org>2013-03-04 08:32:26 +0000
commit1f714019b3e733efef8a00d266fdd20f4439d535 (patch)
tree0e189e66acc681386d0d85f7813f9a2a254da638
parentb7fe949ffbbbc7aa507053f67fded0cfe77a9290 (diff)
Added first simple bash rsync script.
-rw-r--r--scripts/rsync-mirror15
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
+