Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #/bin/bash
- #Ubuntu release mirror
- #mirror@dhakacom.com
- fatal() {
- echo "$1"
- exit 1
- }
- warn() {
- echo "$1"
- }
- # Find a source mirror near you which supports rsync on
- # https://launchpad.net/ubuntu/+cdmirrors
- # rsync://<iso-country-code>.rsync.releases.ubuntu.com/releases should always work
- RSYNCSOURCE=rsync://us1.releases.ubuntu.com/releases
- # Define where you want the mirror-data to be on your mirror
- BASEDIR=/var/www/html/ubuntu-releases/
- if [ ! -d ${BASEDIR} ]; then
- warn "${BASEDIR} does not exist yet, trying to create it..."
- mkdir -p ${BASEDIR} || fatal "Creation of ${BASEDIR} failed."
- fi
- rsync --verbose --recursive --times --links --hard-links \
- --stats --delete-after \
- ${RSYNCSOURCE} ${BASEDIR} || fatal "Failed to rsync from ${RSYNCSOURCE}."
- date -u > ${BASEDIR}/.trace/$(hostname -f)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement