Personal tools
You are here: Home Fedora Solved Server Solutions Repository Sychronization Script

Repository Sychronization Script

by kanarip last modified Jan 30, 2008 03:46 AM
— filed under:

This is a repository synchronization script for Fedora. It enables administrators to synchronize a local mirror of several repositories using the RSYNC protocol. Currently supported repositories are Fedora Core, Updates, Extras, Source and Livna.

Why a repository synchronization script?

When having several machines running Fedora, installing and updating these machines may cause a huge load on your Internet connection, and it may be slow -slower then your LAN-. If you're not using a caching proxy server to connect your machines to the Internet, you may also be downloading the same files over and over again with each machine you install or update. This causes "unnecessary" traffic. To create such a local mirror, you need to update and synchronize your mirror every now and then.

What does the synchronization script do?

The synchronization script takes command line parameters to determine which repositories you want to synchronize. Once it has determined the complete list of repositories, it synchronizes those from a list of mirrors you specify. It really is that simple.

There are more difficult ways to sychronize your mirror, though. Some mirror scripts use hardlinks or symlinks to save you some disk space. This script doesn't, so remember that when you're running out of disk space. The disk space for one release and one architecture is about 5GB. Whenever you specify another release or architecture to synchronize, add an additional 5GB of disk space to the expected total amount of disk space your mirror will use.

The Script

Usage:

./sync_repo [OPTIONS] repo1 repo2 repo3

The options and repository parameters are described in the tables below.

Optiondescription
--devel
Include all development repositories. This includes the default repositories, and their development equivalents.
--source
Include all source repositories. This includes the default repositories and their sources.
--testing
Include all testing repositories. This includes the default repositories and their testing equivalents.
--legacy
Include legacy repositories.
--debuginfo
Include debuginfo repositories.
--nocore
Exclude core repositories.
--noupdates
Exclude updates repositories.
--noextras
Exclude extras repositories.
--nolivna
Exclude livna repositories.
--excludenoyum
Exclude all components that are not used by yum. This, for example, includes the .iso files, as well as the 'stylesheet-images/' directory.
--delete
A very important option. Specify this option to keep your local mirror exactly synchronized. If you do not specify --delete, all files on the local mirror that are not on the remote mirrors anymore, will be kept, but they will not be used because the repodata does not include these.

repository parameter
description
fc
Synchronize all of the Fedora repository tree. Without the --devel, --source and --testing options, this defaults to the following repositories: core, core-sources, updates, updates-sources, extras, extras-sources, livna and livna-sources
fc-5  Synchronize all of the Fedora repository tree for release 5. Without the --devel, --source and --testing options, this defaults to the following repositories: core, core-sources, updates, updates-sources, extras, extras-sources, livna and livna-sources.
Substitute '5' for any valid release number of Fedora Core.
fc-5-i386
Synchronize all of the Fedora repository tree for release 5, architecture i386. Without the --devel, --source and --testing options, this defaults to the following repositories: core, core-sources, updates, updates-sources, extras, extras-sources, livna and livna-sources.
Substitute '5' for any valid release number of Fedora Core, or substitute 'i386' for any valid architecture.
So, a few examples to explain:


If you would want to sychronize all of the Fedora repository tree for release 5 and architecture i386, you would run:

./sync_repo fc-5-i386

This synchronizes the following repositories:

  1. core
  2. updates
  3. extras
  4. livna

If you'd also want the sources, run:

./sync_repo --source fc-5-i386

This synchronizes the same repositories, including:

  1. core-sources
  2. updates-sources
  3. extras-sources
  4. livna-sources

If you specify more then one option, the options become cumulative:

./sync_repo --source --testing fc-5-i386

This would sychronize all of the above, and:

  1. updates-testing
  2. updates-testing-source
  3. extras-testing
  4. extras-testing-source
  5. livna-testing
  6. livna-testing-source
Related content
Document Actions
Log in


Forgot your password?
New user?