openmamba-headserver-tools/etc/cron.weekly/20-gencontents

36 lines
918 B
Plaintext
Raw Normal View History

2012-03-12 15:18:41 +01:00
#!/bin/bash
. /etc/sysconfig/openmamba-central
echo "Creating contentslist file"
CONTENTSLISTFILE=$local_ftp/contentslist-i586
CONTENTS_FILELIST=""
for rep in ${local_reps[*]} ${remote_reps[*]}; do
[ -e $local_ftp/$rep/contentslist-i586 ] &&
CONTENTS_FILELIST="$CONTENTS_FILELIST \
$local_ftp/$rep/contentslist-i586"
done
[ "$CONTENTS_FILELIST" ] && {
sort $CONTENTS_FILELIST > $local_ftp/contentslist-i586
bzip2 -f $CONTENTSLISTFILE
}
for c in $CONTENTS_FILELIST; do
bzip2 -f $c
# mv $c.bz2 `dirname $c`/..
done
echo "Syncing contentslist file"
curl -T $CONTENTSLISTFILE.bz2 \
-u$ftpuser:$ftppass --url $dest_ftp/pub/openmamba/
for rep in ${local_reps[*]} ${remote_reps[*]}; do
[ -e $local_ftp/$rep/contentslist-i586.bz2 ] &&
curl -T $local_ftp/$rep/contentslist-i586.bz2 \
-u$ftpuser:$ftppass \
--url $dest_ftp/pub/openmamba/$rep/
done