]> git.decadent.org.uk Git - dak.git/blobdiff - config/homedir/syncdd.sh
Do not sync any lock files.
[dak.git] / config / homedir / syncdd.sh
index 43219716b4487f00f62187b66f19810d4384bf42..07c4bc5145485491c682f38b0e8bd0255f6a47c1 100755 (executable)
@@ -26,6 +26,43 @@ export LC_ALL=C
 export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars
 . $SCRIPTVARS
 
+EXTRA=""
+
+check_commandline() {
+    while [ $# -gt 0 ]; do
+        case "$1" in
+            sync)
+                EXTRA="--exclude ftp/"
+                ;;
+            pool)
+                ;;
+            *)
+                echo "Unknown option ${1} ignored"
+                ;;
+        esac
+        shift  # Check next set of parameters.
+    done
+}
+
+if [ $# -gt 0 ]; then
+    ORIGINAL_COMMAND=$*
+else
+    ORIGINAL_COMMAND=""
+fi
+
+SSH_ORIGINAL_COMMAND=${SSH_ORIGINAL_COMMAND:-""}
+if [ -n "${SSH_ORIGINAL_COMMAND}" ]; then
+    set "nothing" "${SSH_ORIGINAL_COMMAND}"
+    shift
+    check_commandline $*
+fi
+
+if [ -n "${ORIGINAL_COMMAND}" ]; then
+    set ${ORIGINAL_COMMAND}
+    check_commandline $*
+fi
+
+
 cleanup() {
     rm -f "${HOME}/sync.lock"
 }
@@ -38,31 +75,37 @@ trap cleanup EXIT TERM HUP INT QUIT
 if lockfile -r3 ${HOME}/sync.lock; then
     cd $base/
     rsync -aH -B8192 \
-           --exclude backup/*.xz \
-           --exclude backup/dump* \
-           --exclude ftp/ \
-           --exclude mirror/ \
-           --exclude morgue/ \
-           --exclude=lost+found/ \
-           --exclude .da-backup.trace \
-           --delete \
-           --delete-after \
-           --timeout 3600 \
-           -e 'ssh -o ConnectTimeout=30 -o SetupTimeout=30' \
-           ftpmaster-sync:/srv/ftp-master.debian.org/ .
+        --exclude backup/*.xz \
+        --exclude backup/dump* \
+        --exclude database/\*.db \
+        ${EXTRA} \
+        --exclude mirror \
+        --exclude morgue/ \
+        --exclude=lost+found/ \
+        --exclude .da-backup.trace \
+        --exclude lock/ \
+        --exclude queue/holding/ \
+        --exclude queue/newstage/ \
+        --exclude queue/unchecked/ \
+        --exclude tmp/ \
+        --delete \
+        --delete-after \
+        --timeout 3600 \
+        -e 'ssh -o ConnectTimeout=30 -o SetupTimeout=30' \
+        ftpmaster-sync:/srv/ftp-master.debian.org/ .
 
     cd $public/
-    rsync -avH -B8192 \
-           --exclude mirror \
-           --exclude rsync/ \
-           --exclude=lost+found/ \
-           --exclude .da-backup.trace \
-           --exclude web-users/ \
-           --delete \
-           --delete-after \
-           --timeout 3600 \
-           -e 'ssh -o ConnectTimeout=30 -o SetupTimeout=30' \
-           ftpmaster-sync2:/srv/ftp.debian.org/ .
+    rsync -aH -B8192 \
+        --exclude mirror \
+        --exclude rsync/ \
+        --exclude=lost+found/ \
+        --exclude .da-backup.trace \
+        --exclude web-users/ \
+        --delete \
+        --delete-after \
+        --timeout 3600 \
+        -e 'ssh -o ConnectTimeout=30 -o SetupTimeout=30' \
+        ftpmaster-sync2:/srv/ftp.debian.org/ .
 
 else
     echo "Couldn't get the lock, not syncing"