[MacPorts] Mirroring modified

MacPorts noreply at macports.org
Mon Aug 8 14:40:20 PDT 2016


Page "Mirroring" was changed by ryandesign at macports.org
Diff URL: <https://trac.macports.org/wiki/Mirroring?action=diff&version=21>
Revision 21
Comment: add new rsync update script that prefers syncing the single macports rsync module
Changes:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: Mirroring
=========================================================================
--- Mirroring (version: 20)
+++ Mirroring (version: 21)
@@ -101,12 +101,43 @@
 
 === Sample rsync update script
 
-This sample script can be used to mirror the MacPorts rsync modules.
-
-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.
+This sample script can be used to mirror all MacPorts content to your server using rsync.
+
+For 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.
 
 {{{
 #!/bin/bash
+
+# This script mirrors all MacPorts content from RSYNC_URL to RSYNC_DIR.
+
+set -euo pipefail
+
+RSYNC_DIR="/var/www/html/macports"
+
+RSYNC_URL="rsync://rsync-origin.macports.org/macports/"
+#RSYNC_URL="rsync://jnb.za.rsync.macports.org/macports/"
+#RSYNC_URL="rsync://jog.id.rsync.macports.org/macports/"
+#RSYNC_URL="rsync://lil.fr.rsync.macports.org/macports/"
+#RSYNC_URL="rsync://nue.de.rsync.macports.org/macports/"
+#RSYNC_URL="rsync://osl.no.rsync.macports.org/macports/"
+
+RSYNC="rsync"
+RSYNC_ARGS="--compress --delete-delay --hard-links --links --no-motd --perms --recursive --stats --timeout=600 --times"
+if [ -t 1 ]; then
+    RSYNC_ARGS="$RSYNC_ARGS --info=progress2"
+fi
+
+echo "Syncing from $RSYNC_URL to $RSYNC_DIR"
+$RSYNC $RSYNC_ARGS "$RSYNC_URL" "$RSYNC_DIR"
+echo
+}}}
+
+If 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.
+
+{{{
+#!/bin/bash
+
+# This script mirrors the selected RSYNC_MODULES from RSYNC_URL to RSYNC_DIR.
 
 set -euo pipefail
 
@@ -126,7 +157,7 @@
 #RSYNC_URL_FORMAT="rsync://osl.no.rsync.macports.org/macports/%s/"
 #RSYNC_URL_FORMAT="rsync://sea.us.rsync.macports.org/%s/"
 
-RSYNC=rsync
+RSYNC="rsync"
 RSYNC_ARGS="--compress --delete-delay --hard-links --links --no-motd --perms --recursive --stats --timeout=600 --times"
 if [ -t 1 ]; then
     RSYNC_ARGS="$RSYNC_ARGS --info=progress2"
@@ -134,7 +165,7 @@
 
 for RSYNC_MODULE in $RSYNC_MODULES; do
     RSYNC_URL="$(printf "$RSYNC_URL_FORMAT" "$RSYNC_MODULE")"
-    echo "Syncing $RSYNC_MODULE from $RSYNC_URL"
+    echo "Syncing from $RSYNC_URL to $RSYNC_DIR/$RSYNC_MODULE"
     $RSYNC $RSYNC_ARGS "$RSYNC_URL" "$RSYNC_DIR/$RSYNC_MODULE"
     echo
 done
-------8<------8<------8<------8<------8<------8<------8<------8<--------

--
Page URL: <https://trac.macports.org/wiki/Mirroring>
MacPorts <https://www.macports.org/>
Ports system for OS X

This is an automated message. Someone added your email address to be
notified of changes on 'Mirroring' page.
If it was not you, please report to .


More information about the macports-changes mailing list