source: soft/build_system/build_system/upload/robot/trunk/other-push-rsync @ 1

Last change on this file since 1 was 1, checked in by fasma, 13 years ago

Initial Import from Mandriva's soft revision 224062 and package revision 45733

File size: 1.3 KB
Line 
1#!/bin/sh
2
3machine=rsync.mandriva.com
4
5RSYNCOPT=" --bwlimit=50 --delete --copy-unsafe-links -H -l --partial -a -e ssh $@"
6#RSYNCOPT=" --bwlimit=150 --delete --copy-unsafe-links -H -l --partial -a -e ssh --timeout=120 $@"
7
8#LOCK=/mnt/BIG/distrib/cooker/cooker/Mandrake/.update_in_progress
9LOCK=/mnt/BIG/distrib/.update_in_progress
10# check lock created by the admin script to be sure
11# to have a clean tree.
12
13if [ -e "$LOCK" ]; then
14    pid=`cat $LOCK`
15    if [ "$pid" -gt 0 ]; then
16        if [ ! -d /proc/$pid ]; then
17            echo "stale lock: removing it"
18            rm -f "$LOCK"
19        else
20            while [ -d /proc/$pid ]; do
21                if [ -n "$*" ]; then
22                    echo "exiting because $pid is already running"
23                fi
24                exit
25            done
26        fi
27    fi
28fi
29
30# use the same lock to be sure that admin doesn't mess up
31# the tree during the transfer
32echo "$$" > $LOCK
33trap "rm -f $LOCK" 0
34
35ping -c 1 -i 30 $machine > /dev/null
36
37if [ $? != 0 ]; then
38    if [ -n "$*" ]; then
39        echo "$machine is down"
40    fi
41    exit 0
42fi
43
44#rsync $RSYNCOPT /mnt/BIG/distrib/cooker/contrib $machine:mirror/Mandrake-devel
45
46if [ -n "$*" ]; then
47    echo "Mirroring testing to $machine"
48fi
49rsync $RSYNCOPT /mnt/BIG/distrib/testing $machine:mirror/Mandrakelinux/devel/
50ssh $machine "find ~/mirror/Mandrakelinux/devel/testing/ -exec chmod go-w {} \;"
Note: See TracBrowser for help on using the repository browser.