On 2/19/06, O Plameras <[EMAIL PROTECTED]> wrote:

snipped.........

>
> #!/bin/sh
> #
> # Author     : O Plameras
> # Version    : 0.2
> # Date         : 19-Feb-2006
> # Script     : move older versions of rpm or src.rpm files to OBSOLETE/
> dir.
> #               You may remove OBSOLETE after manual examinations.
> #
> # Warning    : Use this script at your own RISK. No Warranty, expressed
> or implied.
> #
> function checkV(){
>         if [ $CUR == $PRV ]; then
>                 mv $PF OBSOLETE/
>                 let C=$C+1
>         fi
>         PRV=$CUR
> }
> PRV="NONE"
> let C=0
> [ -d OBSOLETE ] || mkdir OBSOLETE
> for i in `ls *.rpm`
> do
>         set `echo $i | sed 's/-/ /g'`
>         case "$#" in
>                 3)
>                         CUR=$1
>                         checkV
>                         ;;
>                 4)
>                         CUR=$1-$2
>                         checkV
>                         ;;
>                 5)
>                         CUR=$1-$2-$3
>                         checkV
>                         ;;
>                 *)
>                         ;;
>         esac
>         PF=$i
> done
> #
> echo "There are $C files to remove."
> exit 0
>

Hi,

Thanks a lot.  Your script made a big difference.

My more than 10GB RPM files has become less than 1GB.
A significant reductions by any standard.

It took a while to run but the end results have been extremely good.

Thanks to H Lowndes, too, for the info. I'll look into his suggestions.


PG
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to