3 # Copyright (C) 2011,2013, Joerg Jaspert <joerg@debian.org>
4 # Copyright (C) 2012, Ansgar Burchardt <ansgar@debian.org>
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation; version 2.
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars
30 echo "usage: $0 <lock> <host1> <host2> sync|pool"
32 echo "sync dd-accessible copy of the archive"
35 echo " lock: file used for locking"
36 echo " host1: hostname for syncing /srv/ftp-master.debian.org"
37 echo " host2: hostname for syncing /srv/ftp.debian.org"
38 echo " sync|pool: sync excludes ftp/, pool syncs ftp/ too"
46 lockfile="${lockdir}/${1}"
51 # extra options for rsync of /srv/ftp-master.debian.org
58 echo "Unknown mode ${mode}." >&2
66 trap cleanup EXIT TERM HUP INT QUIT
68 # Also, NEVER use --delete-excluded!
69 if lockfile -r3 "${lockfile}"; then
72 --exclude "/.nobackup" \
73 --exclude "/backup/*.xz" \
74 --exclude "/backup/dump*" \
75 --exclude "/build-queues/" \
76 --exclude "/database/*.db" \
77 --exclude ".da-backup.trace" \
78 --exclude "/export/changelogs/tmp*/" \
80 --exclude "lost+found" \
83 --exclude "/morgue/" \
84 --exclude "/queue/bts_version_track/" \
85 --exclude "/queue/unchecked/" \
87 --exclude "/scripts/s3kr1t" \
89 --delete --delete-after \
91 -e 'ssh -o ConnectTimeout=30 -o SetupTimeout=30' \
92 /srv/ftp-master.debian.org/ "${host1}:/srv/ftp-master.debian.org/"
93 # command for the remote side:
94 # command="rsync --server -lHogDtpre.iLsf -B8192 --timeout=3600 --delete-after . /srv/ftp-master.debian.org/"
97 --exclude "/.nobackup" \
100 --exclude lost+found \
101 --exclude .da-backup.trace \
102 --exclude web-users/ \
103 --delete --delete-after \
105 -e 'ssh -o ConnectTimeout=30 -o SetupTimeout=30' \
106 /srv/ftp.debian.org/ "${host2}:/srv/ftp.debian.org/"
107 # command for the remote side:
108 # command="rsync --server -lHogDtpre.iLsf -B8192 --timeout=3600 --delete-after . /srv/ftp.debian.org/"
110 echo "Couldn't get the lock, not syncing"