18674
|
1 #!/usr/bin/env bash
|
|
2 # MPlayer mirroring script
|
|
3 # $Id$
|
|
4
|
|
5 PATH=<set_path_if_necessary>
|
|
6 LOCK=<path_to_lockfile>
|
|
7 MIRROR_ROOT=<path_to_mirror_root>
|
|
8 MAILADR=<report_mail_to_adr>
|
|
9
|
|
10 #TMPDIR = /tmp
|
|
11 #export TMPDIR
|
|
12
|
|
13 TMPFILE=`mktemp -t mplayer.XXXXXXXXXXX`
|
|
14
|
|
15 # Check to see if another sync is in progress
|
|
16 if lockfile -! -l 43200 -r 0 "$LOCK"; then
|
|
17 echo Unable to start mirroring MPlayer, lock file exists.
|
|
18 exit 1
|
|
19 fi
|
|
20 trap "rm -f $LOCK > /dev/null 2>&1" exit
|
|
21
|
|
22 cd $MIRROR_ROOT
|
|
23
|
|
24 echo "************ rsyncing homepage ************" >>$TMPFILE
|
|
25 rsync -pxlrHtWv --delete --delete-after natsuki.mplayerhq.hu::homepage/ \
|
|
26 homepage >>$TMPFILE 2>&1
|
|
27
|
|
28 echo "************ rsyncing MPlayer ************" >>$TMPFILE
|
|
29 rsync -pxlrHtWv --delete --delete-after --exclude '/benchmark' \
|
|
30 --exclude '/old_stuff' --exclude '/tests' \
|
|
31 --exclude '/README.incoming' natsuki.mplayerhq.hu::ftp/ \
|
|
32 MPlayer >>$TMPFILE 2>&1
|
|
33
|
|
34 x=`wc -l $TMPFILE|awk '{print $1}'`
|
|
35 if [ "$x" -ne "10" ]
|
|
36 then
|
|
37 mailx -s "mplayer mirror" $MAILADR <$TMPFILE
|
|
38 fi
|
|
39 rm -f $TMPFILE
|
|
40
|