#!/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 || exit 1

# bring all of the repo including CVSROOT
# but don't bring any locks!
rsync -a --exclude 'CVSROOT/config' --exclude '#cvs.*' --quiet --delete cvsmirror.moodle.org::moodle /git/import/moodle/moodlemirror.cvs

# release me
dotlockfile -u  /var/tmp/moodle-sync.lock || echo could not release lock


