[CentOS-mirror] rsync mirroring script

Rafal Maszkowski

rzm at icm.edu.pl
Fri Mar 6 13:43:03 UTC 2015

On Wed, Feb 25, 2015 at 07:27:57AM -0800, Brian Downey wrote:
> We've been using this simple script for years and it works great.  If I had
> to guess, the error you're receiving is because you're missing the second
> ':' between the host and module in the rsync statement.

I have developped a simple mirror() bash function. It
- can be run from cron or by hand,
- uses locks (via lockfile command),
- can have several packages in one script (even if they need different
  mirroring frequency),
- can dry run to show the actual rsync command,
- remembers time of last mirroring and last successful mirroring,
- (and more).

My CentOS mirroring script which calls the mirror() function is quite
	. /local/scripts/mirror/mirror-functions
	mirror	rsync://eu-msync.centos.org/CentOS/	$p/linux-centos

There may be more  mirror ...  lines, preceeded with e.g. gap=12
(meaning: do not mirror if 12 hours have not yet passed since last
_successful_ mirroring; default is 2 hours). The are also other options.

I have placed the scripts with examples on our server:

„Walczy on z całym zapamiętaniem przeciwko intelektowi” - z akt personalnych prof. A. Baeumlera

More information about the CentOS-mirror mailing list