#!/bin/bash # # openmamba repository sync-back script # (c) 2006-2008 by Silvan Calarco # . /etc/sysconfig/openmamba-central [ "$dest_rsync" ] && { RSYNC_OPT="-av --no-o --delete --delete-excluded" [ "`pidof rsync`" ] && { echo "Error: an rsync process is already running; exiting for safety." exit 1 } for rep in ${remote_reps[*]}; do [[ "`/usr/bin/tty`" != "not a tty" ]] && echo "==> Syncing back $rep remote repository" for a in ${archs[*]}; do rsync \ $RSYNC_OPT \ $dest_rsync/$rep/RPMS.$a $local_ftp/$rep \ --password-file=/etc/rsync.password --bwlimit=500 \ --exclude old > /dev/null done rsync \ $RSYNC_OPT \ $dest_rsync/$rep/SRPMS.base $local_ftp/$rep \ --password-file=/etc/rsync.password --bwlimit=500 \ --exclude old >/dev/null rsync \ $RSYNC_OPT \ $dest_rsync/$rep/home $local_ftp/$rep \ --password-file=/etc/rsync.password --bwlimit=500 \ --exclude old > /dev/null # rsync \ # $RSYNC_OPT \ # $dest_rsync/$rep/autoupdate $local_ftp/$rep \ # --password-file=/etc/rsync.password --bwlimit=500 \ # --exclude */old > /dev/null done exit 0 } [ "$ftpsync" -a "$dest_ftp" ] && { for a in ${remote_reps[*]}; do [[ "`/usr/bin/tty`" != "not a tty" ]] && echo "==> Syncing back remote $a repository" ftpsync -q -g $local_ftp/$a/RPMS.i586 \ $dest_ftp/pub/openmamba/$a/RPMS.i586 ftpuser=$ftpuser ftppasswd=$ftppass ftpsync -q -g $local_ftp/$a/SRPMS.base \ $dest_ftp/pub/openmamba/$a/SRPMS.base ftpuser=$ftpuser ftppasswd=$ftppass done }