[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [linux-team] Aux pros de l'install SuSE



Voici le petit utilitaire dont je parlais pour se faciliter la vie lors
d'un dégraissage d'installation trop volumineuse.

	Alain 

-------------------------------------------------------------------------
Dr Alain EMPAIN, Informatics, Site Master
   National Botanic Garden of Belgium
   B-1860 MEISE, Belgium 
Phone: +32 2 2600 940(direct) 2600 920(central)      Fax: +32 2 2600 945 
Home:  +32 85 512341     alain@BR.fgov.be(work&home) [Céline: celine@ping.be]


TM=`date +%y%m%d%H%M`
echo
echo
echo "=== RPM inventory ====================================alain@br.fgov.be=="
echo "The resulting lists are kept within my standard repository (/home/bag)"
echo "  * three lists are generated : "
echo "      rpm.qa (all), rpm.srt (sorted by name) and rpm.sz (sorted by size)"
echo "  * a time stamp is included in the archive"
echo "  * a symbolic simplified name is provided for the current archive"
echo
echo "  ==> it can be used to keep the history of the RPM content, "
echo "      and to restore a previous configuration (or to prepare a new profile)"
echo
echo -n "Enter a suffix for the archive [default=hostname] => "
	read SUFFIX
	if [ -z $SUFFIX ]
	then 
		SUFFIX=`hostname`
	fi
echo "..Suffix= <$SUFFIX> (creating /home/bag if needed)"
	if [ ! -d  /home/bag ]
	then mkdir /home/bag
	fi
	echo "   (now in /home/bag)"
	cd /home/bag
echo "..RPM query all"
	rpm -qa > rpm.qa
echo "..RPM sizes"
	cat rpm.qa | xargs rpm -qi | egrep "^Size" | cut -c15-25 > rpm.sz
echo "..RPM sorted by sizes (/home/bag/rpm.sz)"
	paste rpm.sz rpm.qa | sort -n > rpm.srt
	TAR0=rpm${SUFFIX}_${TM}.tgz
	TAR1=rpm_${SUFFIX}.tgz
echo "..Tarring the information into $TAR1,"
echo "                     linked to $TAR0"
	tar -czvf $TAR0 rpm.qa rpm.sz rpm.srt
	ln -sf $TAR0 $TAR1