diff --git a/mirror_mageia b/mirror_mageia index 2306082..756cecf 100644 --- a/mirror_mageia +++ b/mirror_mageia @@ -13,18 +13,18 @@ MSG=/tmp/mirror_mageia.mail #SERVEUR="http://ftp.free.fr/mirrors/mageia.org" #SERVEUR="rsync://ftp.acc.umu.se/mirror/mageia/" SERVEUR="rsync://ftp.belnet.be/mageia" - echo "" >$MSG + function title() { echo -e "\e[1;32m$1\e[0m" - echo -e "\e[1;32m$1\e[0m" >>$MSG + echo -e "$1" >>$MSG } function info() { echo -e "\e[36m$1\e[0m" - echo -e "\e[36m$1\e[0m" >>$MSG + echo -e "$1" >>$MSG } iferror( ) #$RESULT, $TXT, $LINENO @@ -33,8 +33,8 @@ iferror( ) #$RESULT, $TXT, $LINENO echo -e "$2: réussi" echo -e "$2: réussi" >>$MSG else - echo -e "\e[36m$3 - $2\e[0m: échoué" - echo -e "\e[36m$3 - $2\e[0m: échoué" >>$MSG + echo -e "\e[36m$3 - $2\e[0m: échoué" + echo -e "$3 - $2: échoué" >>$MSG fi } @@ -42,10 +42,11 @@ iferror( ) #$RESULT, $TXT, $LINENO title "Synchronisation miroirs Mageia" pidof -o %PPID -x -s mirror_mageia if [ $? -eq 0 ];then + echo "" >$MSG info "mirror_mageia déjà lancé" else #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/ if [ $? -eq 0 ]; then @@ -74,7 +75,7 @@ else else info "Erreur rsync Mageia $PRESENT" - fiF + fi rsync -avP --exclude "*GNOME*" $SERVEUR/iso/$PRESENT* "$MIRRORPATH"/iso/ iferror "$?" "rsync Mageia $PRESENT isos" $LINENO @@ -149,4 +150,3 @@ else chmod a+rX -R "$MIRRORPATH"/distrib fi sendmail -f $FROMMAIL $DESTMAIL <$MSG -