Note: You are currently viewing documentation for Moodle 2.0. Up-to-date documentation for the latest stable version is available here: How to set up a CVS mirror.

How to set up a CVS mirror

From MoodleDocs

This document will outline the exact steps to set up a CVS mirror that Moodle users can use to download Moodle and maintain their web sites. (It could use some help to flesh it out!)

Hardware

Operating System

CVS Server

CVS Repository

Please make sure that your Moodle repository is available under /cvsroot/moodle (for compatibility with all the other mirrors).

Mirroring Moodle repository

You can easily mirror the Moodle repository to your own machine using rsync to copy recently changed files. You can simply run these commands (every 15 minutes, using cron):

cd [your local directory]

rsync -av --delete rsync://moodle.cvs.sourceforge.net/cvsroot/moodle/moodle .
rsync -av --delete rsync://moodle.cvs.sourceforge.net/cvsroot/moodle/contrib .
rsync -av --delete rsync://moodle.cvs.sourceforge.net/cvsroot/moodle/mysql .
rsync -av --delete rsync://moodle.cvs.sourceforge.net/cvsroot/moodle/lang .

It is a good idea to wrap this up as a shell script, and use a lock or semaphore to prevent a pileup of processes if there's a snag anywhere. Last thing we want is to end up placing too much load on SF again. The script below is what MartinL uses on Eduforge.org --

#!/bin/bash

# get the lock,
# - don't retry too hard, it's ok if we miss a run
# - single-server so -p means we'll consider the lock stale
#   if the pid isn't around
# 
dotlockfile -p -r2 /var/tmp/moodle-sync.lock

# bring all of the repo including CVSROOT
rsync -a --quiet --delete rsync://moodle.cvs.sourceforge.net/cvsroot/moodle/* ~/moodle-cvsmirror

# release me!
dotlockfile -u  /var/tmp/moodle-sync.lock

Monitoring your service

Letting us know

To inform the community and have your server's details added to our mirror network, contact Martin Dougiamas at moodle.com via the helpdesk.