openmamba-headserver-tools/etc/cron.daily/10-openmamba-mirror-daily

44 lines
1.2 KiB
Plaintext
Raw Normal View History

2012-03-12 15:18:41 +01:00
#!/bin/bash
#
# openmamba daily sync script
# (c) 2006-2008 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
. /etc/sysconfig/openmamba-central
RSYNC_OPT="-av --no-o --delete --delete-after"
echo "Creating and syncing pkglist"
for a in ${local_reps[*]}; do
distromatic -q -t $a --genpkglist > $local_ftp/$a/pkglist
[ "$ftpsync" ] && {
curl -s -T $local_ftp/$a/pkglist -u$ftpuser:$ftppass --url $dest_ftp/pub/openmamba/$a/
}
done
if [ "$ftpsync" ]; then
echo "Syncing openmamba devel utils dir"
ftpsync -q -p $local_ftp/devel/utils \
$dest_ftp/pub/openmamba/devel/utils ftpuser=$ftpuser ftppasswd=$ftppass
fi
echo "Syncing openmamba db dir"
if [ "$ftpsync" ]; then
ftpsync -q -p $local_ftp/db \
$dest_ftp/pub/openmamba/db ftpuser=$ftpuser ftppasswd=$ftppass
else
rsync \
$RSYNC_OPT \
$local_ftp/db $dest_rsync \
--password-file=/etc/rsync.password --bwlimit=400
fi
echo "Syncing openmamba lists"
if [ "$ftpsync" ]; then
ftpsync -q -p $local_ftp/lists \
$dest_ftp/pub/openmamba/lists ftpuser=$ftpuser ftppasswd=$ftppass
else
rsync \
$RSYNC_OPT \
$local_ftp/lists $dest_rsync \
--password-file=/etc/rsync.password --bwlimit=400
fi