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. |
| 104 | This sample script can be used to mirror all MacPorts content to your server using rsync. |
| 105 | |
| 106 | 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. |
| 110 | |
| 111 | # This script mirrors all MacPorts content from RSYNC_URL to RSYNC_DIR. |
| 112 | |
| 113 | set -euo pipefail |
| 114 | |
| 115 | RSYNC_DIR="/var/www/html/macports" |
| 116 | |
| 117 | RSYNC_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 | |
| 124 | RSYNC="rsync" |
| 125 | RSYNC_ARGS="--compress --delete-delay --hard-links --links --no-motd --perms --recursive --stats --timeout=600 --times" |
| 126 | if [ -t 1 ]; then |
| 127 | RSYNC_ARGS="$RSYNC_ARGS --info=progress2" |
| 128 | fi |
| 129 | |
| 130 | echo "Syncing from $RSYNC_URL to $RSYNC_DIR" |
| 131 | $RSYNC $RSYNC_ARGS "$RSYNC_URL" "$RSYNC_DIR" |
| 132 | echo |
| 133 | }}} |
| 134 | |
| 135 | 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. |
| 136 | |
| 137 | {{{ |
| 138 | #!/bin/bash |
| 139 | |
| 140 | # This script mirrors the selected RSYNC_MODULES from RSYNC_URL to RSYNC_DIR. |