IsoSyncShellScript
This is a simple bash script that I wrote to handle syncing the Lucid daily builds to my local system. It's a little more specific than the regular mirror scripts as it only updates/tracks individual ISOs. I didn't need to mirror the complete cdimages.ubuntu.com site, so this is the product of necessity. <jeffrey AT ubuntu DOT com>
Before You Begin
It depends on a few things being set up properly before it will work though.
- Set up directory structure like this:
- /home/username/isos /home/username/isos/lucid /home/username/isos/lucid/kubuntu #this holds the Kubuntu i386, amd64 and netbook ISOs /home/username/isos/lucid/server #this holds the ubuntu-server ISOs /home/username/isos/lucid/ubuntu #this holds the ubuntu-desktop and ubuntu-netbook ISOs /home/username/isos/lucid/xubuntu #this holds the Xubuntu i386, amd64 and netbook ISOs Other versions can be added, but will require some tweaking of the script by adding ISOPATH entries to point
zsync to the correct place on http://cdimages.ubuntu.com
- /home/username/isos /home/username/isos/lucid /home/username/isos/lucid/kubuntu #this holds the Kubuntu i386, amd64 and netbook ISOs /home/username/isos/lucid/server #this holds the ubuntu-server ISOs /home/username/isos/lucid/ubuntu #this holds the ubuntu-desktop and ubuntu-netbook ISOs /home/username/isos/lucid/xubuntu #this holds the Xubuntu i386, amd64 and netbook ISOs Other versions can be added, but will require some tweaking of the script by adding ISOPATH entries to point
- zsync needs to be installed. This depends on zsync, which is faster than rsync as it only pulls down a diff
- of each image and syncs from that. rsync is slower and pulls down entire ISO images based on non-matching MD5SUMs.
- before you can zsync, you need to populate your iso directories with the ISOs you want to keep synced. You
- can do this using rsync, wget or even a web browser, or possibly the torrents for the ISOs
To Use
- cp /path/to/isosync.sh /home/username/isos
- edit isosync.sh and make sure you change the following to match your system:
- HOMEDIR -- set to match your home directory
- SOMETHING_PATH variables -- add any you need that aren't there (for ARM images or other things)
- run like this
- ./isosync.sh VERSION (where VERSION is the directory you wish to update, e.g. lucid (see above)
You should then see output similar to the following as isosync.sh runs:
bladernr@klaatu:~/isos$ ./isosync.sh lucid/ Now entering /home/bladernr/isos/lucid//kubuntu Preparing to zsync Kubuntu images in /home/bladernr/isos/lucid/kubuntu ################################### Now syncing lucid-desktop-amd64.iso from http://cdimages.ubuntu.com/cdimage/kubuntu/daily-live/current/ zsync complete for lucid-desktop-amd64.iso ################################### ################################### Now syncing lucid-desktop-i386.iso from http://cdimages.ubuntu.com/cdimage/kubuntu/daily-live/current/ zsync complete for lucid-desktop-i386.iso ################################### ################################### Now syncing lucid-netbook-i386.iso from http://cdimages.ubuntu.com/cdimage/kubuntu-netbook/daily-live/current zsync complete for lucid-netbook-i386.iso ################################### Now entering /home/bladernr/isos/lucid//server ################################### Now syncing lucid-server-amd64.iso from http://cdimages.ubuntu.com/cdimage/ubuntu-server/daily/current/ zsync complete for lucid-server-amd64.iso ################################### ################################### Now syncing lucid-server-i386.iso from http://cdimages.ubuntu.com/cdimage/ubuntu-server/daily/current/ zsync complete for lucid-server-i386.iso ################################### Now entering /home/bladernr/isos/lucid//ubuntu ################################### Now syncing lucid-desktop-amd64.iso from http://cdimages.ubuntu.com/cdimage/daily-live/current/ zsync complete for lucid-desktop-amd64.iso ################################### ################################### Now syncing lucid-desktop-i386.iso from http://cdimages.ubuntu.com/cdimage/daily-live/current/ zsync complete for lucid-desktop-i386.iso ################################### ################################### Now syncing lucid-netbook-i386.iso from http://cdimages.ubuntu.com/cdimage/ubuntu-netbook/daily-live/current/ zsync complete for lucid-netbook-i386.iso ################################### Now entering /home/bladernr/isos/lucid//xubuntu ################################### Now syncing lucid-desktop-amd64.iso from http://cdimages.ubuntu.com/cdimage/xubuntu/daily-live/current/ zsync complete for lucid-desktop-amd64.iso ################################### ################################### Now syncing lucid-desktop-i386.iso from http://cdimages.ubuntu.com/cdimage/xubuntu/daily-live/current/ zsync complete for lucid-desktop-i386.iso ###################################
The script
-- bladernr 2010-03-11 22:22:36
IsoSyncShellScript (last edited 2010-03-11 22:22:36 by nc-71-54-45-201)