-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsourceforge
executable file
·50 lines (37 loc) · 1.59 KB
/
sourceforge
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
#!/bin/bash
SOURCE_DIR=~/git/netkiller.github.io
TARGET_DIR=~/workspace/netkiller.sourceforge.net
PUBLIC_HTML=~/workspace/
mkdir -p $TARGET_DIR
#echo "find $SOURCE_DIR -type d | egrep -v '(zh-tw|.svn|.git)'"
for dir in $(find $SOURCE_DIR -type d | egrep -v '(zh-tw|.svn|/.git)' | sed -e "s:^$SOURCE_DIR/::g");
do
mkdir -p $TARGET_DIR/$dir
done
for file in $(find $SOURCE_DIR -type f | egrep -v '(zh-tw|.svn|/.git)' )
do
output_file=$(echo $file | sed -e "s:^$SOURCE_DIR:$TARGET_DIR:g") # -e "s:^/::g")
if [ "${file##*.}" = "html" ]
then
cconv -f UTF8-CN -t UTF8-HK $file -o $output_file &
else
cp $file $output_file &
fi
echo $file
done
# sftp://netkiller,[email protected]:/home/groups/n/ne/netkiller/htdocs
# rsync -auzv --delete * [email protected]:/home/user-web/n/ne/netkiller/htdocs/
#RSYNC="rsync --archive --update --compress --delete --progress --stats --exclude=.svn"
#RSYNC="rsync --archive --update --compress --delete --stats --exclude=.svn"
RSYNC="rsync --archive --compress --delete --stats -vP --exclude=.svn"
REMOTE="netkiller,[email protected]:/home/groups/n/ne/netkiller/htdocs"
LOCAL="${PUBLIC_HTML}/netkiller.sourceforge.net"
if [ -z $1 ]; then
#./sitemaps http://netkiller.sourceforge.net | gzip > ${LOCAL}/sitemaps.xml.gz
eval "$RSYNC $LOCAL/* $REMOTE"
else
$RSYNC $LOCAL/$1 $REMOTE
fi
#./sitemaps http://netkiller.sourceforge.net > /tmp/sitemap.xml
#$RSYNC /tmp/sitemaps.xml.gz /tmp/sitemap.xml $REMOTE
#$RSYNC /tmp/sitemaps.xml.gz $REMOTE/