source: soft/build_system/build_system/upload/robot/trunk/rsync_old_ken @ 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
3LOCK=/mnt/BIG/distrib/.update_in_progress
4
5if [ -e $LOCK ]; then
6    pid=`cat $LOCK`
7    if [ $pid -gt 0 ]; then
8        kill -0 $pid > /dev/null 2>&1
9        if [ $? != 0 ]; then
10            echo "stale lock: removing it"
11            rm -f "$LOCK"
12        else
13            echo "Another cowboy is running $0 ($pid)"
14            exit
15        fi
16    fi
17fi
18
19echo $$ > $LOCK
20
21#for machine in raoh old_ken; do
22for machine in raoh; do
23
24#ping -c 1 -i 30 $machine > /dev/null
25#
26#if [ $? != 0 ]; then
27#    if [ -n "$*" ]; then
28#       echo "$machine is down"
29#    fi
30#    exit 0
31#fi
32    port=22
33    RSYNC="rsync -lHar --timeout=120 --delete $@"
34    if [[ $machine == old_ken ]]; then
35        port=222
36    fi
37
38    if ! ssh -x -p $port $machine ls /mnt/BIG/distrib/.update_in_progress; then
39       
40        ssh -x -p $port $machine touch /mnt/BIG/distrib/.update_from_ken
41# distro
42        $RSYNC -e "ssh -x -p $port -c arcfour" /mnt/BIG/dis/cooker $machine:/mnt/BIG/dis/
43        $RSYNC -e "ssh -x -p $port -c arcfour" /mnt/BIG/dis/community $machine:/mnt/BIG/dis/
44
45# updates
46        $RSYNC -e "ssh -x -p $port -c arcfour" /mnt/BIG/dis/updates $machine:/mnt/BIG/dis/
47        $RSYNC -e "ssh -x -p $port -c arcfour" /mnt/BIG/dis/updates_pro $machine:/mnt/BIG/dis/
48        ssh -x -p $port $machine rm -f /mnt/BIG/distrib/.update_from_ken
49    else
50        echo Upload already in progress on $machine
51    fi
52done
53
54rm $LOCK
Note: See TracBrowser for help on using the repository browser.