sync-release 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #! /bin/bash
  2. # Copyright (C) 2016, Ansgar Burchardt <ansgar@debian.org>
  3. #
  4. # This program is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU General Public License as
  6. # published by the Free Software Foundation; version 2.
  7. #
  8. # This program is distributed in the hope that it will be useful, but
  9. # WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. # General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software
  15. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. set -e
  17. set -u
  18. set -E
  19. export LANG=C
  20. export LC_ALL=C
  21. export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars
  22. . $SCRIPTVARS
  23. usage() {
  24. echo "usage: $0 <codename>"
  25. echo
  26. echo "sync dists/<codename> to a location accessible by the release team"
  27. echo "excluding irrelevant bits (such as installer images)"
  28. exit ${1:-0}
  29. }
  30. if [ $# -ne 1 ]; then
  31. usage
  32. fi
  33. codename="${1}"
  34. archive_path=$(psql -qAtc "SELECT path FROM archive WHERE id = (SELECT archive_id FROM suite WHERE codename='${codename}')")
  35. target="sync-release:/srv/ftp-master.debian.org/tmp-release/"
  36. rsync -avH --progress -B8192 \
  37. --relative \
  38. --exclude "/dists/${codename}/main/installer-*" \
  39. --timeout 3600 \
  40. -e 'ssh -o ConnectTimeout=30 -o SetupTimeout=30' \
  41. "${archive_path:?}/./dists/${codename}/" "${archive_path:?}/./zzz-dists/${codename}/" "${target}"
  42. # command for the remote side:
  43. # rsync --server -lHogDtprRe.iLsfx -B8192 --timeout=3600 . /srv/ftp-master.debian.org/tmp-release/