All pastes #104808 Raw Edit

gen-yum-headers

public shellscript v1 · immutable
#104808 ·published 2006-07-29 07:23 UTC
rendered paste body
#!/bin/sh## this script does the setup for a yum repos#X=`date +%H`case "$X" in     02|03|04|05)        MINUTES=14400                                   # During the night we check for 14400 minutes = 10 days ?        ;;     *)        MINUTES=70                                      # normally we check if there where changes in the directory tree the                                                        # last 70 minutes.         ;;esacPUBDIR=/home/ftp/pub/YUMDIR=${PUBDIR}yumIFS=""## evaluate arguments#while [ $# -gt 0 ]do   case "$1" in      -D)         DEBUG=-x         set $DEBUG         shift         ;;      -a)         MINUTES=7200000         shift         ;;      -m)         shift         MINUTES=$1         shift         ;;      -?)         echo "Usage: $0 [-D] [-a] [-m <minutes>] [-?]"         exit         ;;      *)         shift         ;;   esacdonecd ${YUMDIR}umask 0022## run yum-arch for each directory#for DIR in `ls -d *.*/*` ; do    echo -en "`date +%Y%m%d%H%M%S` ${YUMDIR}/${DIR}     "    ROWS=`find ${YUMDIR}/${DIR} -follow -cmin -$MINUTES -name "*rpm" | wc -l | sed 's/ //g'`    if [ $ROWS = 0 ]; then       echo " nothing changed"    else       cd ${YUMDIR}/${DIR}       echo " changes found, rebuilding repository"       yum-arch -v .    fidonecd ${YUMDIR}