Laden...

Update von Red Hat RHEL, Centos und SL Distributionen

Fuer diese OS Familie wird ein Systemupdate normalerweise mit Hilfe von “yum“ durchgefuehrt.

 


Headnode:

 

centos54

centos53

centos52

opensuse-11.2

opensuse-11.1

sles10sp2

sl53

sl54

ubuntu-9.10

 

 

 

[root@m1 log]# less /usr/local/sbin/update-mirror.sh

#!/bin/bash

 

set -x

 

# source projekt.conf

. /srv/cluster-autoinstall/config-space/etc/projekt.conf

 

# set for testpurposes only, after test it will be commented out

CONFIG_LINUX_DISTRO=centos54

 

# find out which Linux distribution ist installed?

if [${CONFIG_LINUX_DISTRO:0:2} –eq ce ]; then

  lin_distri=centos

  echo “Linux distribution = $lin_distri”

  distri_version=${CONFIG_LINUX_DISTRO:6:1}.=${CONFIG_LINUX_DISTRO:7:1}

  distri_version_comp=${CONFIG_LINUX_DISTRO:6:2}

 

  echo “Linux distribution version = $distri_version / $distri_version-comp”

 

 

  SAVELOG=${SAVELOG:-"/srv/cluster-autoinstall/config-space/scripts/savelog -c 10"}

 

 

  RSYNCCMD=${RSYNCCMD:-/usr/bin/rsync}

  echo “RSYNCCMD = $RSYNCCMD

 

  RSYNC_OPTS=${RSYNC_OPTS:-"-a -i --stats --delete --delete-excluded"}

  echo “RSYNC = $RSYNC”

 

  LOG=/var/log/centos-$distri_version-mirror.log

  echo “LOG = $LOG”

 

  #echo "Starting Update of Centos mirror - $(date)" >> $LOG 2>&1

 

  $RSYNCCMD $RSYNC_OPTS                                             \

  echo “rsync://ftp-stud.fht-esslingen.de/centos/$distri_version/os/x86_64/          \”

  echo “/srv/cluster-autoinstall/centos-mirror/centos/$distri_version/os/x86_64          >> $LOG 2>&1”

 

  $RSYNCCMD $RSYNC_OPTS                                             \

  echo “rsync://ftp-stud.fht-esslingen.de/centos/$distri_version/updates/x86_64/     \”

  echo “/srv/cluster-autoinstall/centos-mirror/centos/$distri_version_comp/updates/x86_64     >> $LOG 2>&1”

 

  echo ‘"Finished Update of Centos mirror - $(date)" >> $LOG 2>&1’

 

  # logrotating

  $SAVELOG $LOG

fi

 

 

 

  if [ $number_of_distros -gt 0 ]; then

    echo

    echo "Welches Linux Distribution soll verwendet werden?"

    echo

    count=0

    for distro in $(cat .linux-distros_${template}); do

      count=$(( count + 1 ))

      available_distro[$count]=$distro

      echo " ${count}) ${available_distro[$count]}"

    done

 

    echo

    read_input "Nummer der Linux Distro"

    if [ $user_input -gt $number_of_distros ] || [ $user_input -lt 1 ]; then

      echo "Bitte Angabe im Bereich 1) - ${number_of_distros})"

      exit 1

    fi

    linux_distro=${available_distro[$user_input]}

  else

    echo

    echo "Bisher steht noch kein Template fuer ${template} zur Verfuegung. Abbruch"

    echo

    exit 1

  fi

 

 

 

SAVELOG=${SAVELOG:-"/srv/cluster-autoinstall/config-space/scripts/savelog -c 10"}

RSYNCCMD=${RSYNCCMD:-/usr/bin/rsync}

RSYNC_OPTS=${RSYNC_OPTS:-"-a -i --stats --delete --delete-excluded"}

LOG=/var/log/centos-5.3-mirror.log

 

echo "Starting Update of Centos mirror - $(date)" >> $LOG 2>&1

 

$RSYNCCMD $RSYNC_OPTS                                             \

 rsync://ftp-stud.fht-esslingen.de/centos/5.3/os/x86_64/          \

 /srv/cluster-autoinstall/centos-mirror/centos/53/os/x86_64          >> $LOG 2>&1

 

$RSYNCCMD $RSYNC_OPTS                                             \

 rsync://ftp-stud.fht-esslingen.de/centos/5.3/updates/x86_64/     \

 /srv/cluster-autoinstall/centos-mirror/centos/53/updates/x86_64     >> $LOG 2>&1

 

echo "Finished Update of Centos mirror - $(date)" >> $LOG 2>&1

 

# logrotating

$SAVELOG $LOG

[root@m1 log]#

 

 

[root@m1 ~]# /usr/local/sbin/update-mirror.sh

 

 

 

 

Computenodes:

 

[root@m1 ~]# pdsh -a yum update

 

Update Script des Headnodes:

 

[root@m1 ~]# less /usr/local/sbin/update-mirror.sh

#!/bin/bash

 

set -x

 

SAVELOG=${SAVELOG:-"/srv/cluster-autoinstall/config-space/scripts/savelog -c 10"}

RSYNCCMD=${RSYNCCMD:-/usr/bin/rsync}

RSYNC_OPTS=${RSYNC_OPTS:-"-a -i --stats --delete --delete-excluded"}

LOG=/var/log/centos-5.3-mirror.log

 

echo "Starting Update of Centos mirror - $(date)" >> $LOG 2>&1

 

$RSYNCCMD $RSYNC_OPTS                                             \

 rsync://ftp-stud.fht-esslingen.de/centos/5.3/os/x86_64/          \

 /srv/cluster-autoinstall/centos-mirror/centos/53/os/x86_64          >> $LOG 2>&1

 

$RSYNCCMD $RSYNC_OPTS                                             \

 rsync://ftp-stud.fht-esslingen.de/centos/5.3/updates/x86_64/     \

 /srv/cluster-autoinstall/centos-mirror/centos/53/updates/x86_64     >> $LOG 2>&1

 

echo "Finished Update of Centos mirror - $(date)" >> $LOG 2>&1

 

# logrotating

$SAVELOG $LOG

[root@m1 ~]#

Article Details: Views:
Last updated:
2010/07/15
Article
article viewed 143 times
Autor:
Autor
Dieter Nikisch