Changes between Version 20 and Version 21 of Mirroring


Ignore:
Timestamp:
Aug 8, 2016, 9:40:18 PM (8 years ago)
Author:
ryandesign (Ryan Carsten Schmidt)
Comment:

add new rsync update script that prefers syncing the single macports rsync module

Legend:

Unmodified
Added
Removed
Modified
  • Mirroring

    v20 v21  
    102102=== Sample rsync update script
    103103
    104 This sample script can be used to mirror the MacPorts rsync modules.
    105 
    106 For your initial sync of ''packages'' and ''distfiles'', you can possibly make your transfer faster by uncommenting the `RSYNC_URL_FORMAT` line for a mirror server closer to you, but note that currently not all servers mirror all modules, and not all servers follow our module naming suggestions. For subsequent scheduled syncs, use the origin server.
     104This sample script can be used to mirror all MacPorts content to your server using rsync.
     105
     106For your initial sync, you can possibly make your transfer faster by uncommenting the `RSYNC_URL` line for a mirror server closer to you. For subsequent scheduled syncs, use the origin server to ensure you get the latest content.
    107107
    108108{{{
    109109#!/bin/bash
     110
     111# This script mirrors all MacPorts content from RSYNC_URL to RSYNC_DIR.
     112
     113set -euo pipefail
     114
     115RSYNC_DIR="/var/www/html/macports"
     116
     117RSYNC_URL="rsync://rsync-origin.macports.org/macports/"
     118#RSYNC_URL="rsync://jnb.za.rsync.macports.org/macports/"
     119#RSYNC_URL="rsync://jog.id.rsync.macports.org/macports/"
     120#RSYNC_URL="rsync://lil.fr.rsync.macports.org/macports/"
     121#RSYNC_URL="rsync://nue.de.rsync.macports.org/macports/"
     122#RSYNC_URL="rsync://osl.no.rsync.macports.org/macports/"
     123
     124RSYNC="rsync"
     125RSYNC_ARGS="--compress --delete-delay --hard-links --links --no-motd --perms --recursive --stats --timeout=600 --times"
     126if [ -t 1 ]; then
     127    RSYNC_ARGS="$RSYNC_ARGS --info=progress2"
     128fi
     129
     130echo "Syncing from $RSYNC_URL to $RSYNC_DIR"
     131$RSYNC $RSYNC_ARGS "$RSYNC_URL" "$RSYNC_DIR"
     132echo
     133}}}
     134
     135If you wish to mirror only some of our content, you can instead use the following script and remove unwanted modules from the RSYNC_MODULES line.
     136
     137{{{
     138#!/bin/bash
     139
     140# This script mirrors the selected RSYNC_MODULES from RSYNC_URL to RSYNC_DIR.
    110141
    111142set -euo pipefail
     
    127158#RSYNC_URL_FORMAT="rsync://sea.us.rsync.macports.org/%s/"
    128159
    129 RSYNC=rsync
     160RSYNC="rsync"
    130161RSYNC_ARGS="--compress --delete-delay --hard-links --links --no-motd --perms --recursive --stats --timeout=600 --times"
    131162if [ -t 1 ]; then
     
    135166for RSYNC_MODULE in $RSYNC_MODULES; do
    136167    RSYNC_URL="$(printf "$RSYNC_URL_FORMAT" "$RSYNC_MODULE")"
    137     echo "Syncing $RSYNC_MODULE from $RSYNC_URL"
     168    echo "Syncing from $RSYNC_URL to $RSYNC_DIR/$RSYNC_MODULE"
    138169    $RSYNC $RSYNC_ARGS "$RSYNC_URL" "$RSYNC_DIR/$RSYNC_MODULE"
    139170    echo