44 lines
1.2 KiB
Bash
Executable File
44 lines
1.2 KiB
Bash
Executable File
#!/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
|