-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb-sync
executable file
·97 lines (89 loc) · 3.3 KB
/
web-sync
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/sh -x
#
# web-sync - Resync engr web site with latest sources
#
# Michael Jennings <[email protected]>
# 28 Sept 2000
#
# $Id: web-sync,v 1.17 2001/12/20 22:33:18 mej Exp $
#
umask 022
if [ ! -z "$SUDO_USER" ]; then
USER=$SUDO_USER
elif [ "x$USER" = "x" ]; then
USER=`whoami`
fi
LOCAL_DIR=/var/web/vermillion
REMOTE_HOST=antigen.nplus1.net
REMOTE_DIR=/os/build.mezzanine
REMOTE_USER=$USER
REMOTE_GROUP=www-data
REMOTE_UHOST=$USER@$REMOTE_HOST
SCP_CMD="scp -C"
RSYNC_CMD="rsync -e $HOME/bin/office -Pav --exclude=CVS --exclude=.cvsignore --exclude=.*.symlinks --delete --delete-excluded"
CHOWN_CMD="chown -R $REMOTE_USER:$REMOTE_GROUP"
CHMOD_CMD="chmod -R u+w,a+r,og-w"
if [ "x$1" = "x" ]; then
echo "Usage: `/bin/basename $0` <version> [ <version> ... ]"
exit -1
fi
for i in $* ; do
case $i in
6.2.*)
REMOTE_UHOST=mej@grendel
REMOTE_DIR=/grendel/scratch/mej/6.2.4/build
LOCAL_DIR=/home/ftp/pub/software/RH-VALE/unsupported
for j in os powertools ; do
mkdir -p $LOCAL_DIR/$i/$j
cd $LOCAL_DIR/$i/$j
echo "*** Synchronizing $j ***"
mkdir -p $LOCAL_DIR/$i/$j/cd
$RSYNC_CMD $REMOTE_UHOST:$REMOTE_DIR/vermillion-$j-rpms/ $LOCAL_DIR/$i/$j/cd/
echo "*** Copying ISO images ***"
mkdir -p $LOCAL_DIR/$i/$j/iso
$RSYNC_CMD $REMOTE_UHOST:$REMOTE_DIR/vermillion-redhat-$j-'*'.iso $LOCAL_DIR/$i/$j/iso/
echo "*** Creating RPMS directory ***"
mkdir -p $LOCAL_DIR/$i/$j/RPMS
rm -f RPMS/*.rpm
(cd cd ; find . \( -name '*.rpm' -a ! -name '*src.rpm' \) -exec cp -a {} ../RPMS/ \;)
echo "*** Creating SRPMS directory ***"
mkdir -p $LOCAL_DIR/$i/$j/SRPMS
if [ "$j" = "os" ]; then
$RSYNC_CMD $REMOTE_UHOST:$REMOTE_DIR/vermillion-$j-srpms/SRPMS/ $LOCAL_DIR/$i/$j/SRPMS/
else
$RSYNC_CMD $REMOTE_UHOST:$REMOTE_DIR/vermillion-$j-srpms/Powertools/SRPMS/ $LOCAL_DIR/$i/$j/SRPMS/
fi
echo "*** Fixing ownerships and permissions ***"
$CHOWN_CMD RPMS SRPMS iso
$CHMOD_CMD RPMS SRPMS iso
done
echo "*** Syncing buffy files ***"
$RSYNC_CMD $REMOTE_UHOST:$REMOTE_DIR/buffy $LOCAL_DIR/$i/
echo "*** Sync of $i done ***"
;;
7.*)
cd $LOCAL_DIR/$i
echo "*** Synchronizing network install image ***"
mkdir -p $LOCAL_DIR/$i/os/image
$RSYNC_CMD $REMOTE_UHOST:$REMOTE_DIR/vermillion-$i-net/ $LOCAL_DIR/$i/os/image/
echo "*** Copying ISO images ***"
mkdir -p $LOCAL_DIR/$i/os/iso
$RSYNC_CMD $REMOTE_UHOST:$REMOTE_DIR/vermillion-os-'*'.iso $LOCAL_DIR/$i/os/iso/
echo "*** Synchronizing extras ***"
mkdir -p $LOCAL_DIR/$i/extras/image
$RSYNC_CMD $REMOTE_UHOST:$REMOTE_DIR/vermillion-$i-extras/ $LOCAL_DIR/$i/extras/image/
echo "*** Copying ISO images ***"
mkdir -p $LOCAL_DIR/$i/extras/iso
$RSYNC_CMD $REMOTE_UHOST:$REMOTE_DIR/vermillion-extras-'*'.iso $LOCAL_DIR/$i/extras/iso/
for j in RPMS SRPMS ; do
echo "*** Synchronizing $j ***"
mkdir -p $LOCAL_DIR/$i/$j
$RSYNC_CMD $REMOTE_UHOST:$REMOTE_DIR/vermillion-$i-www/$j/ $LOCAL_DIR/$i/$j/
done
echo "*** Fixing ownerships and permissions ***"
$CHOWN_CMD RPMS SRPMS os/iso extras/iso
$CHMOD_CMD RPMS SRPMS os/iso extras/iso
echo "*** Sync of $i done ***"
;;
esac
done