1
0

minor bug

This commit is contained in:
Daniel Tartavel 2019-01-12 17:36:07 +01:00
parent bc0e82cfa1
commit 2d17309a6e

View File

@ -13,18 +13,18 @@ MSG=/tmp/mirror_mageia.mail
#SERVEUR="http://ftp.free.fr/mirrors/mageia.org" #SERVEUR="http://ftp.free.fr/mirrors/mageia.org"
#SERVEUR="rsync://ftp.acc.umu.se/mirror/mageia/" #SERVEUR="rsync://ftp.acc.umu.se/mirror/mageia/"
SERVEUR="rsync://ftp.belnet.be/mageia" SERVEUR="rsync://ftp.belnet.be/mageia"
echo "" >$MSG
function title() function title()
{ {
echo -e "\e[1;32m$1\e[0m" echo -e "\e[1;32m$1\e[0m"
echo -e "\e[1;32m$1\e[0m" >>$MSG echo -e "$1" >>$MSG
} }
function info() function info()
{ {
echo -e "\e[36m$1\e[0m" echo -e "\e[36m$1\e[0m"
echo -e "\e[36m$1\e[0m" >>$MSG echo -e "$1" >>$MSG
} }
iferror( ) #$RESULT, $TXT, $LINENO iferror( ) #$RESULT, $TXT, $LINENO
@ -34,7 +34,7 @@ iferror( ) #$RESULT, $TXT, $LINENO
echo -e "$2: réussi" >>$MSG echo -e "$2: réussi" >>$MSG
else else
echo -e "\e[36m$3 - $2\e[0m: échoué" echo -e "\e[36m$3 - $2\e[0m: échoué"
echo -e "\e[36m$3 - $2\e[0m: échoué" >>$MSG echo -e "$3 - $2: échoué" >>$MSG
fi fi
} }
@ -42,10 +42,11 @@ iferror( ) #$RESULT, $TXT, $LINENO
title "Synchronisation miroirs Mageia" title "Synchronisation miroirs Mageia"
pidof -o %PPID -x -s mirror_mageia pidof -o %PPID -x -s mirror_mageia
if [ $? -eq 0 ];then if [ $? -eq 0 ];then
echo "" >$MSG
info "mirror_mageia déjà lancé" info "mirror_mageia déjà lancé"
else else
#Mageia current version #Mageia current version
echo "" >$MSG
rsync -a -H -S -v --delete-after --delete-excluded --delay-updates --exclude="*testing" --exclude="*debug/" --exclude="SRPMS/" $SERVEUR/distrib/$PRESENT/ "$MIRRORPATH"/distrib/$PRESENT/ rsync -a -H -S -v --delete-after --delete-excluded --delay-updates --exclude="*testing" --exclude="*debug/" --exclude="SRPMS/" $SERVEUR/distrib/$PRESENT/ "$MIRRORPATH"/distrib/$PRESENT/
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
@ -74,7 +75,7 @@ else
else else
info "Erreur rsync Mageia $PRESENT" info "Erreur rsync Mageia $PRESENT"
fiF fi
rsync -avP --exclude "*GNOME*" $SERVEUR/iso/$PRESENT* "$MIRRORPATH"/iso/ rsync -avP --exclude "*GNOME*" $SERVEUR/iso/$PRESENT* "$MIRRORPATH"/iso/
iferror "$?" "rsync Mageia $PRESENT isos" $LINENO iferror "$?" "rsync Mageia $PRESENT isos" $LINENO
@ -149,4 +150,3 @@ else
chmod a+rX -R "$MIRRORPATH"/distrib chmod a+rX -R "$MIRRORPATH"/distrib
fi fi
sendmail -f $FROMMAIL $DESTMAIL <$MSG sendmail -f $FROMMAIL $DESTMAIL <$MSG