Browse CVS Repository
Contents of /samurai-graph/web/rsync.sh
Parent Directory
| Revision Log
| Revision Graph
Revision 1.4 -
( show annotations)
( download)
( as text)
Tue Feb 8 14:55:04 2005 UTC
(19 years, 1 month ago)
by orrisroot
Branch: MAIN
CVS Tags: RELEASE_2_0_0, HEAD
Changes since 1.3: +13 -0 lines
File MIME type: text/x-sh
added group write permission to uploaded files.
| 1 |
#!/bin/sh |
| 2 |
RSYNC=`which rsync` |
| 3 |
if [ x"$RSYNC" = x ]; then |
| 4 |
echo "error : rsync command required" |
| 5 |
exit 1; |
| 6 |
fi |
| 7 |
RSYNC_OPTS="-rlvzC --delete" |
| 8 |
RSYNC_RSH=ssh |
| 9 |
export RSYNC_RSH |
| 10 |
SRC=`dirname $0`/htdocs |
| 11 |
DSTDIR=/home/groups/s/sa/samurai-graph |
| 12 |
SFJP_SHELL_HOSTNAME=sf-usr-shell |
| 13 |
SFJP_HOST=shell.sourceforge.jp |
| 14 |
|
| 15 |
FIND_DIR="find $DSTDIR/htdocs/* -type d" |
| 16 |
FIND_FILE="find $DSTDIR/htdocs -type f" |
| 17 |
|
| 18 |
if [ `hostname -s` = $SFJP_SHELL_HOSTNAME ]; then |
| 19 |
DST=$DSTDIR |
| 20 |
else |
| 21 |
DST=$SFJP_HOST:$DSTDIR |
| 22 |
fi |
| 23 |
|
| 24 |
if [ ! -d $SRC ]; then |
| 25 |
echo "error : no web contents on $SRC" |
| 26 |
exit 1; |
| 27 |
fi |
| 28 |
$RSYNC $RSYNC_OPTS $SRC $DST |
| 29 |
|
| 30 |
# added group write permission |
| 31 |
if [ `hostname -s` = $SFJP_SHELL_HOSTNAME ]; then |
| 32 |
chmod 775 `$FIND_DIR` |
| 33 |
chmod 664 `$FIND_FILE` |
| 34 |
else |
| 35 |
ssh $SFJP_HOST "chmod 775 \`$FIND_DIR\`" |
| 36 |
ssh $SFJP_HOST "chmod 664 \`$FIND_FILE\`" |
| 37 |
fi |
| 38 |
|
|