3 # Copyright (C) 2011 Joerg Jaspert <joerg@debian.org>
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License as
7 # published by the Free Software Foundation; version 2.
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars
32 while [ $# -gt 0 ]; do
35 EXTRA="--exclude ftp/"
40 echo "Unknown option ${1} ignored"
43 shift # Check next set of parameters.
53 SSH_ORIGINAL_COMMAND=${SSH_ORIGINAL_COMMAND:-""}
54 if [ -n "${SSH_ORIGINAL_COMMAND}" ]; then
55 set "nothing" "${SSH_ORIGINAL_COMMAND}"
60 if [ -n "${ORIGINAL_COMMAND}" ]; then
61 set ${ORIGINAL_COMMAND}
67 rm -f "${HOME}/sync.lock"
69 trap cleanup EXIT TERM HUP INT QUIT
71 # not using $lockdir as thats inside the rsync dir, and --delete would
72 # kick the lock away. Yes we could exclude it, but wth bother?
74 # Also, NEVER use --delete-excluded!
75 if lockfile -r3 ${HOME}/sync.lock; then
78 --exclude backup/*.xz \
79 --exclude backup/dump* \
80 --exclude database/\*.db \
84 --exclude=lost+found/ \
85 --exclude .da-backup.trace \
87 --exclude queue/holding/ \
88 --exclude queue/newstage/ \
89 --exclude queue/unchecked/ \
94 -e 'ssh -o ConnectTimeout=30 -o SetupTimeout=30' \
95 ftpmaster-sync:/srv/ftp-master.debian.org/ .
101 --exclude=lost+found/ \
102 --exclude .da-backup.trace \
103 --exclude web-users/ \
107 -e 'ssh -o ConnectTimeout=30 -o SetupTimeout=30' \
108 ftpmaster-sync2:/srv/ftp.debian.org/ .
111 echo "Couldn't get the lock, not syncing"
116 ## ftpmaster-sync is defined in .ssh/config as:
117 # Host ftpmaster-sync
118 # Hostname franck.debian.org
120 # IdentityFile ~dak/.ssh/syncftpmaster
123 # StrictHostKeyChecking yes
124 # PasswordAuthentication no
127 ## ftpmaster-sync2 is the same, just a second ssh key