Collection of scripts for linux rpm/deb repositories mirroring
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Config update and gitignoring. Aug 25, 2015
LICENSE Initial commit Oct 31, 2013
deb-mirror Added cleanup of index files before fetch Sep 16, 2015
switch-repos Start Oct 31, 2013


Script set for partial rpm/deb repositories mirroring with sanity check.


WARNING: This set of scripts is not designed to be used on 'live' repositories that are available to clients during synchronization It violates common synchronization order(packages first, metadata later) to provide partial mirroring capability. It means that repositories will be inconsistent during the update. Please use these scripts in conjunction with snapshots, on inactive repos, etc.

Only rsync mirrors are supported.

There are currently three mirroring scripts, all of them take path to config file as a first argument.

  • rpm-mirror - script for mirroring RPM repositories
  • deb-mirror - script for mirroring DEB repositories
  • arch-mirror - script for mirroring Archlinux repositories

You can see some config examples at the config/ directory.


Clone this repo to preferable location, for example /opt/mirror-sync:

cd /opt
git clone mirror-sync

Create user for running mirroring scripts:

adduser --no-create-home --home /opt/mirror-sync mirror

Create repository storage, for example at /srv/www/mirror and give ownership to mirror user:

mkdir -p /srv/www/mirror/{debian,centos}
chown -R mirror:mirror /srv/www/mirror

Optionally create log directory:

mkdir -p /var/log/mirror-sync
chown -R mirror:mirror /var/log/mirror-sync

Create/edit configuration files for required repositories:

vim /opt/mirror-sync/config/centos.cfg
vim /opt/mirror-sync/config/debian.cfg

Now you can start synchronization of desired repository:

/opt/mirror-sync/rpm-mirror /opt/mirror-sync/config/centos.cfg


/opt/mirror-sync/deb-mirror /opt/mirror-sync/config/debian.cfg