This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Mirror, Mirroring, Download, Downloading Cygwin Release Using rsync

From time to time, as even now, someone asks a question on how to download Cygwin for installing, locally, on any number of machines, burning a CD/DVD, etc. The canonical answer seems to be to use Cygwin's Setup. If "Setup" doesn't run on your system of choice (e.g. FreeBSD, GNU/Linux...), then how? Although "Setup" does run on my windows machine, I don't normally use it to download release changes. Instead, I use rsync, which should work as well on *nix type systems as on a M$ one. So here's how I do it and what works for me--see the bash script below.

I use rsync to maintain a local Cygwin release mirror so I can use Setup to locally install anything from Cygwin release on a number of PCs on my network. I have been doing this for several years with virtually no problems--except for the occasional rsync mirror that comes or goes.

The nice thing about rsync is that it downloads only what has changed since the last rsync and with the "--delete" option, it deletes everything on the local mirror that's not on the official Cygwin mirror being used.(NB: Not so with wget. It just lets things pile up.) Also, rsync is very robust in that, should the download be interrupted, it can be restarted and it picks up, basically, from where it left off. Moreover, you can still use Setup on an M$ machine to download and install changes using the same local directory structure, e.g. /cygdrive/x/cygwin/release. However, using the "--delete" option, the directories left by Setup will be removed the next time rsync is run but everything will be current.

Be advised that disk space may now be an issue. Several years ago, when I started using rsync to mirror Cygwin release, it did so in about 800MB. Now it takes about 2.4GB--somebody has been busy--thanks! However, frequent rsyncs will only need to download a fraction of that.

Below is the bash script I start manually on my Win98SE system. It's brutish, lacks sophistication, but works for me. Because my Cygwin install is Unix, I use Windows' Wordpad (write.exe) to read the log files (hence, the ".wri" extension). Wordpad can handle both the file size and line ends properly whereas notepad can't. The script first runs rsync to download any changes to Setup.exe and Setup.ini, placing them in /cygdrive/n/pub/Cygwin from where I can run Setup. The script then runs rsync to update /cygdrive/n/pub/Cygwin/release with the latest changes. If I first want to see what the new changes are (more or less) without downloading, I do a "dry run" (rsync -n option). After rsyncing, I can do a local install with Setup from any machine on my network.

I just updated the script with the latest rsync mirrors found on the Cygwin site. Normally, I only use mirror 1 or 2 in the list. If there were more North American mirrors, I'd try my hand at selecting the one to use randomly, rather than by menu--share the load.

I hope someone finds this information useful and that it's not redundant.


Lowell Anderson

-----cut here-----

# Select the rsync mirror to use.

while [ 1 ] ; do
echo ""
echo "Select the rsync mirror to use or exit:"
echo "1) rsync:// --Utah"
echo "2) rsync:// --Palo Alto"
echo "3) rsync:// --Ireland"
echo "4) rsync:// --Germany"
echo "5) rsync:// --Germany"
echo "6) rsync:// --Korea"
echo "7) rsync:// --Singapore"
echo ""
echo "0) exit program"
echo ""
echo -n "Enter selection 0-7:"
read selection
echo ""

case $selection in
1 ) rsyncsite="rsync://"
2 ) rsyncsite="rsync://"
3 ) rsyncsite="rsync://"
4 ) rsyncsite="rsync://"
5 ) rsyncsite="rsync://"
6 ) rsyncsite="rsync://"
7 ) rsyncsite="rsync://"
0 ) echo "OK! Exiting";
exit 1;;
* ) echo "Please enter one of 0 to 7"


echo -n "Do you want a dry run? (yes/no) 'var1': "

read var1

if [ "$var1" = "yes" ]


rsync -vaunt --progress --stats --delete $rsyncsite/set* /cygdrive/n/pub/cygwin > /cygdrive/n/pub/CygwinMgmt/drsetlog.wri

rsync -vaunrt --progress --stats --delete $rsyncsite/release /cygdrive/n/pub/cygwin > /cygdrive/n/pub/CygwinMgmt/drreleaselog.wri


if [ "$var1" = "no" ]


rsync -vaut --progress --stats --delete $rsyncsite/set* /cygdrive/n/pub/cygwin > /cygdrive/n/pub/CygwinMgmt/setlog.wri

rsync -vaurt --progress --stats --delete $rsyncsite/release /cygdrive/n/pub/cygwin > /cygdrive/n/pub/CygwinMgmt/releaselog.wri


echo "Just a dry run."


echo "var1 = $var1"


exit 0

-- Unsubscribe info: Problem reports: Documentation: FAQ:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]