1
0

quelques bugs de moins

This commit is contained in:
Daniel Tartavel 2019-01-16 20:41:33 +01:00
parent 813e283c8d
commit 639fa6b14e
2 changed files with 91 additions and 18 deletions

View File

@ -8,11 +8,12 @@ DESTMAIL="contact@lalis.fr"
FROMMAIL="root@lalis.fr" FROMMAIL="root@lalis.fr"
TASKRPM="task-lalis" TASKRPM="task-lalis"
MIRRORPATH="/mirror/mageia" MIRRORPATH="/mirror/mageia"
MEDIAINFO_PATH="$MIRRORPATH/config_lalis"
MSG=/tmp/mirror_mageia.mail MSG=/tmp/mirror_mageia.mail
#SERVEUR="rsync://fr2.rpmfind.net/linux/mageia" SERVEUR="rsync://fr2.rpmfind.net/linux/mageia"
#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"
function title() function title()
@ -42,23 +43,22 @@ iferror( ) #$RESULT, $TXT, $LINENO
echo "Synchronisation miroirs Mageia" echo "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 echo "mirror_mageia déjà lancé"
info "mirror_mageia déjà lancé"
else else
#Mageia current version #Mageia current version
echo "" >$MSG echo "Subject: Synchro miroirs" >$MSG
title "Synchronisation de Mageia $PRESENT" title "Synchronisation de Mageia $PRESENT"
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
cd "$MIRRORPATH"/distrib/$PRESENT cd "$MIRRORPATH"/distrib/$PRESENT
cp $MIRRORPATH/media_info/"$PRESENT"_i586_media.cfg ./i586/media/media_info/media.cfg cp "$MEDIAINFO_PATH"/"$PRESENT"_i586_media.cfg ./i586/media/media_info/media.cfg
iferror "$?" "Copie de "$PRESENT"_i586_media.cfg vers ./i586/media/media_info/media.cfg" $LINENO iferror "$?" "Copie de "$PRESENT"_i586_media.cfg vers ./i586/media/media_info/media.cfg" $LINENO
cp $MIRRORPATH/media_info/"$PRESENT"_x86_64_media.cfg ./x86_64/media/media_info/media.cf cp "$MEDIAINFO_PATH"/"$PRESENT"_x86_64_media.cfg ./x86_64/media/media_info/media.cf
iferror "$?" "Copie de "$PRESENT"_x86_64_media.cfg vers ./x86_64/media/media_info/media.cfg" $LINENO iferror "$?" "Copie de "$PRESENT"_x86_64_media.cfg vers ./x86_64/media/media_info/media.cfg" $LINENO
cp "$MIRRORPATH"/$TASKRPM ./i586/media/core/release/ cp "$MIRRORPATH/$TASKRPM"* ./i586/media/core/release/
iferror "$?" "Copie de $TASKRPM vers ./i586/media/core/release" $LINENO iferror "$?" "Copie de $TASKRPM vers ./i586/media/core/release" $LINENO
cp "$MIRRORPATH"/$TASKRPM ./x86_64/media/core/release/ cp "$MIRRORPATH/$TASKRPM"* ./x86_64/media/core/release/
iferror "$?" "Copie de $TASKRPM vers ./x86_64/media/core/release" $LINENO iferror "$?" "Copie de $TASKRPM vers ./x86_64/media/core/release" $LINENO
nice -n 19 gendistrib --nobadrpm --blind --skipmissingdir ./i586 nice -n 19 gendistrib --nobadrpm --blind --skipmissingdir ./i586
nice -n 19 gendistrib --nobadrpm --blind --skipmissingdir ./x86_64 nice -n 19 gendistrib --nobadrpm --blind --skipmissingdir ./x86_64
@ -87,13 +87,13 @@ else
rsync -v -aHS --delete-after --delete-excluded --delay-updates --exclude=SRPMS/ --exclude "armv5tl/" --exclude=*testing --exclude="*debug/" $SERVEUR/distrib/cauldron/ "$MIRRORPATH"/distrib/cauldron/ rsync -v -aHS --delete-after --delete-excluded --delay-updates --exclude=SRPMS/ --exclude "armv5tl/" --exclude=*testing --exclude="*debug/" $SERVEUR/distrib/cauldron/ "$MIRRORPATH"/distrib/cauldron/
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
cd "$MIRRORPATH"/distrib/cauldron cd "$MIRRORPATH"/distrib/cauldron
cp "$MIRRORPATH"/config/media_info/cauldron_i586_media.cfg ./i586/media/media_info/media.cfg cp "$MEDIAINFO_PATH"/cauldron_i586_media.cfg ./i586/media/media_info/media.cfg
iferror "$?" "Copie de cauldron_i586_media.cfg vers ./i586/media/media_info/media.cfg" $LINENO iferror "$?" "Copie de cauldron_i586_media.cfg vers ./i586/media/media_info/media.cfg" $LINENO
cp "$MIRRORPATH"/config/media_info/cauldron_x86_64_media.cfg ./x86_64/media/media_info/media.cfg cp "$MEDIAINFO_PATH"/cauldron_x86_64_media.cfg ./x86_64/media/media_info/media.cfg
iferror "$?" "Copie de cauldron_x86_64_media.cfg vers ./x86_64/media/media_info/media.cfg" $LINENO iferror "$?" "Copie de cauldron_x86_64_media.cfg vers ./x86_64/media/media_info/media.cfg" $LINENO
cp "$MIRRORPATH"/task ./i586/media/core/release/ cp "$MIRRORPATH/$TASKRPM"* ./i586/media/core/release/
iferror "$?" "Copie de $TASKRPM vers ./i586/media/core/release" $LINENO iferror "$?" "Copie de $TASKRPM vers ./i586/media/core/release" $LINENO
cp "$MIRRORPATH"/$TASKRPM ./x86_64/media/core/release/ cp "$MIRRORPATH/$TASKRPM"* ./x86_64/media/core/release/
iferror "$?" "Copie de $TASKRPM vers ./x86_64/media/core/release" $LINENO iferror "$?" "Copie de $TASKRPM vers ./x86_64/media/core/release" $LINENO
nice -n 19 gendistrib --nobadrpm --blind --skipmissingdir ./i586 nice -n 19 gendistrib --nobadrpm --blind --skipmissingdir ./i586
nice -n 19 gendistrib --nobadrpm --blind --skipmissingdir ./x86_64 nice -n 19 gendistrib --nobadrpm --blind --skipmissingdir ./x86_64
@ -118,13 +118,13 @@ else
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
cd "$MIRRORPATH"/distrib/$OLD cd "$MIRRORPATH"/distrib/$OLD
cp "$MIRRORPATH"/media_info/"$OLD"_i586_media.cfg ./i586/media/media_info/media.cfg cp "$MEDIAINFO_PATH"/"$OLD"_i586_media.cfg ./i586/media/media_info/media.cfg
iferror "$?" "Copie de "$OLD"_i586_media.cfg vers ./i586/media/media_info/media.cfg" $LINENO iferror "$?" "Copie de "$OLD"_i586_media.cfg vers ./i586/media/media_info/media.cfg" $LINENO
cp "$MIRRORPATH"/media_info/"$OLD"_x86_64_media.cfg ./x86_64/media/media_info/media.cf cp "$MEDIAINFO_PATH"/"$OLD"_x86_64_media.cfg ./x86_64/media/media_info/media.cf
iferror "$?" "Copie de "$OLD"_x86_64_media.cfg vers ./x86_64/media/media_info/media.cfg" $LINENO iferror "$?" "Copie de "$OLD"_x86_64_media.cfg vers ./x86_64/media/media_info/media.cfg" $LINENO
cp "$MIRRORPATH"/$TASKRPM ./i586/media/core/release/ cp "$MIRRORPATH/$TASKRPM"* ./i586/media/core/release/
iferror "$?" "Copie de $TASKRPM vers ./i586/media/core/release" $LINENO iferror "$?" "Copie de $TASKRPM vers ./i586/media/core/release" $LINENO
cp "$MIRRORPATH"/$TASKRPM ./x86_64/media/core/release/ cp "$MIRRORPATH/$TASKRPM"* ./x86_64/media/core/release/
iferror "$?" "Copie de $TASKRPM vers ./x86_64/media/core/release" $LINENO iferror "$?" "Copie de $TASKRPM vers ./x86_64/media/core/release" $LINENO
nice -n 19 gendistrib --nobadrpm --blind --skipmissingdir ./i586 nice -n 19 gendistrib --nobadrpm --blind --skipmissingdir ./i586
nice -n 19 gendistrib --nobadrpm --blind --skipmissingdir ./x86_64 nice -n 19 gendistrib --nobadrpm --blind --skipmissingdir ./x86_64
@ -149,5 +149,5 @@ else
#common #common
chown $DEFUSER:$DEFGROUP -R "$MIRRORPATH"/distrib chown $DEFUSER:$DEFGROUP -R "$MIRRORPATH"/distrib
chmod a+rX -R "$MIRRORPATH"/distrib chmod a+rX -R "$MIRRORPATH"/distrib
sendmail -f $FROMMAIL $DESTMAIL <$MSG
fi fi
sendmail -f $FROMMAIL $DESTMAIL <$MSG

73
mirror_mageia_hd Executable file
View File

@ -0,0 +1,73 @@
#!/bin/sh
#mirror_mageia_hd
version="6"
dossier=""
boot=""
param=" --delete-excluded --exclude SRPMS/ --exclude *_testing/ --exclude */debug/ --exclude aarch64/ --exclude armv5tl/ --exclude armv7hl/ "
for DIRECTORY in /run/media/$USER/*
do
echo "$DIRECTORY"
if [ -d "$DIRECTORY" ]; then
if [ -e "$DIRECTORY/mageia/distrib" ]; then
echo "$DIRECTORY/mageia/distrib trouvé"
dossier=$DIRECTORY/mageia/distrib
elif [ -e "$DIRECTORY/extlinux" ]; then
echo "$DIRECTORY/extlinux trouvé"
boot="$DIRECTORY/"
fi
fi
done
if [ -z $dossier ] || [ -z $boot ]; then
for DIRECTORY in /mnt/tmp*
do
if [ -d "$DIRECTORY" ]; then
if [ -e "$DIRECTORY/mageia/distrib" ]; then
echo "$DIRECTORY/mageia/distrib trouvé"
dossier=$DIRECTORY/mageia/distrib
elif [ -e "$DIRECTORY/grub/menu.lst" ]; then
echo "$DIRECTORY/grub/menu.lst trouvé"
boot="$DIRECTORY/"
fi
fi
done
fi
if [ -z $dossier ] || [ -z $boot ]; then
echo "BOOT=$boot"
echo "Dossier=$dossier"
exit 1
fi
if [ -d "/mirror/mageia/distrib/$version" ];then
serveur='/mirror'
else
serveur="rsync://fr2.rpmfind.net/linux"
fi
if [ -n $dossier ] && [ -n $boot ];then
echo "rsync -avP $param $serveur/mageia/distrib/$version/ $dossier/$version/"
rsync -aP $param $serveur/mageia/distrib/$version/x86_64/ $dossier/$version/x86_64/
cd $dossier/$version
echo "rsync -aP i586/isolinux/i386/vmlinuz $boot/vmlinuz_"$version"_i586"
rsync -aP i586/isolinux/i386/vmlinuz $boot/vmlinuz_"$version"_i586
echo" rsync -aP x86_64/isolinux/x86_64/vmlinuz $boot/vmlinuz_"$version"_x86_64"
rsync -aP x86_64/isolinux/x86_64/vmlinuz $boot/vmlinuz_"$version"_x86_64
rsync -aP i586/isolinux/i386/all.rdz $boot/all_"$version"_i586.rdz
rsync -aP x86_64/isolinux/x86_64/all.rdz $boot/all_"$version"_x86_64.rdz
# if [ -d "/mirror/mageia/distrib/cauldron" ];then
# serveur='/mirror'
# else
# serveur="rsync://fr2.rpmfind.net/linux"
# fi
# rsync -aP $param $serveur/mageia/distrib/cauldron/ $dossier/cauldron/
# cd $dossier/cauldron
# rsync -aP i586/isolinux/i386/vmlinuz $boot/vmlinuz_cauldron_i586
# rsync -aP x86_64/isolinux/x86_64/vmlinuz $boot/vmlinuz_cauldron_x86_64
# rsync -aP i586/isolinux/i386/all.rdz $boot/all_cauldron_i586.rdz
# rsync -aP x86_64/isolinux/x86_64/all.rdz $boot/all_cauldron_x86_64.rdz
fi