2 mirror scripts
This commit is contained in:
40
mirror/downloads-mirror.sh
Executable file
40
mirror/downloads-mirror.sh
Executable file
@ -0,0 +1,40 @@
|
||||
#
|
||||
# Simple cron job to mirror the files from google code,
|
||||
# since it doesn't have rsync and neither do our project servers.
|
||||
# Note that the google RSS feed doesn't include old stuff,
|
||||
# so you won't get all the old files when you start this,
|
||||
# only the latest.
|
||||
#
|
||||
# If feed format changes this may break.
|
||||
# No verification, checksums, etc.
|
||||
# We could, I suppose, run gpg --verify on any .sig file and remove
|
||||
# the .sig and base file if it fails.
|
||||
#
|
||||
# by zzz 2010-02
|
||||
#
|
||||
BASE=.
|
||||
RSSURL='http://code.google.com/feeds/p/i2p/downloads/basic'
|
||||
RSSFILE=$BASE/feed.rss
|
||||
PUBLIC=$BASE/public_html
|
||||
#
|
||||
wget "$RSSURL" -O $RSSFILE
|
||||
LINKS=`grep '<a href="' $RSSFILE |
|
||||
cut -f 3 -d ';' |
|
||||
cut -f 1 -d '&'`
|
||||
#
|
||||
for link in $LINKS
|
||||
do
|
||||
file=`basename "$link"`
|
||||
if [ ! -f "$PUBLIC/$file" ]
|
||||
then
|
||||
mkdir -p $PUBLIC
|
||||
wget $link -O "$PUBLIC/$file"
|
||||
if [ "$?" -ne "0" ]
|
||||
then
|
||||
echo "Download of $link failed"
|
||||
rm -f "$PUBLIC/$file"
|
||||
else
|
||||
echo "Download of $link successful"
|
||||
fi
|
||||
fi
|
||||
done
|
9
mirror/website-mirror.sh
Executable file
9
mirror/website-mirror.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#
|
||||
# courtesy of Kilroy
|
||||
# modded by zzz
|
||||
#
|
||||
BASE=$HOME/public_html
|
||||
cd $BASE
|
||||
mtn -d i2p.mtn pull mtn.i2p2.de i2p.www
|
||||
cd $BASE/i2p.www/
|
||||
mtn up
|
Reference in New Issue
Block a user