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 lock/stages/ \
88 --exclude queue/holding/ \
89 --exclude queue/newstage/ \
90 --exclude queue/unchecked/ \
95 -e 'ssh -o ConnectTimeout=30 -o SetupTimeout=30' \
96 ftpmaster-sync:/srv/ftp-master.debian.org/ .
102 --exclude=lost+found/ \
103 --exclude .da-backup.trace \
104 --exclude web-users/ \
108 -e 'ssh -o ConnectTimeout=30 -o SetupTimeout=30' \
109 ftpmaster-sync2:/srv/ftp.debian.org/ .
112 echo "Couldn't get the lock, not syncing"
117 ## ftpmaster-sync is defined in .ssh/config as:
118 # Host ftpmaster-sync
119 # Hostname franck.debian.org
121 # IdentityFile ~dak/.ssh/syncftpmaster
124 # StrictHostKeyChecking yes
125 # PasswordAuthentication no
128 ## ftpmaster-sync2 is the same, just a second ssh key