Mirror getdeb: Difference between revisions

From Skytech
Jump to navigation Jump to search
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..."
 
(No difference)

Latest revision as of 18:50, 11 March 2011

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."