Mirror getdeb

From Skytech
Revision as of 18:50, 11 March 2011 by 192.168.0.250 (talk) (Created page with "== Mirror - getdeb == <pre> #/bin/sh fatal() { echo "$1" exit 1 } warn() { echo "$1" } # RSYNC source RSYNCSOURCE=rsync://rsync.getdeb.net/getdeb/ # Define where you w...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Mirror - getdeb

#/bin/sh

fatal() {
  echo "$1"
  exit 1
}

warn() {
  echo "$1"
}

# RSYNC source
RSYNCSOURCE=rsync://rsync.getdeb.net/getdeb/

# Define where you want the mirror-data to be on your mirror
BASEDIR=$HOME/getdeb

if [ ! -d ${BASEDIR} ]; then
  warn "${BASEDIR} does not exist yet, trying to create it..."
  mkdir -p ${BASEDIR} || fatal "Creation of ${BASEDIR} failed."
fi

rsync --recursive --times --links --hard-links \
  --stats \
  --exclude "Packages*" --exclude "Sources*" \
  --exclude "Release*" \
  ${RSYNCSOURCE} ${BASEDIR} || fatal "First stage of sync failed."

rsync --recursive --times --links --hard-links \
  --stats --delete --delete-after \
  ${RSYNCSOURCE} ${BASEDIR} || fatal "Second stage of sync failed."