A file of remote documentation sources that appears on both the
[rsync-web.git] / vger.txt
1 The vger.rutgers.edu cvs tree is mirrored onto cvs.samba.org via
2 anonymous rsync using the following script.
3
4     #!/bin/bash
5
6     cd /var/www/cvs/vger/
7     PATH=/usr/local/bin:/usr/freeware/bin:/usr/bin:/bin
8
9     RUN=`lps x | grep rsync | grep -v grep | wc -l`
10     if [ "$RUN" -gt 0 ]; then
11             echo already running
12             exit 1
13     fi
14
15     rsync -az vger.rutgers.edu::cvs/CVSROOT/ChangeLog $HOME/ChangeLog
16
17     sum1=`sum $HOME/ChangeLog`
18     sum2=`sum /var/www/cvs/vger/CVSROOT/ChangeLog`
19
20     if [ "$sum1" = "$sum2" ]; then
21             echo nothing to do
22             exit 0
23     fi
24
25     rsync -az --delete --force vger.rutgers.edu::cvs/ /var/www/cvs/vger/
26     exit 0
27
28 Note in particular the initial rsync of the ChangeLog to determine if
29 anything has changed. This could be omitted but it would mean that the
30 rsyncd on vger would have to build a complete listing of the cvs area
31 at each run. As most of the time nothing will have changed I wanted to
32 save the time on vger by only doing a full rsync if the ChangeLog has
33 changed. This helped quite a lot because vger is low on memory and
34 generally quite heavily loaded, so doing a listing on such a large
35 tree every hour would have been excessive.