<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>itsMine &#187; restore</title>
	<atom:link href="http://blog.itsmine.co.uk/tag/restore/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.itsmine.co.uk</link>
	<description></description>
	<lastBuildDate>Sun, 18 Apr 2010 02:28:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<atom:link rel="next" href="http://blog.itsmine.co.uk/tag/restore/feed/?page=2" />

		<item>
		<title>Yum restore script</title>
		<link>http://blog.itsmine.co.uk/2009/01/04/yum-restore-script/</link>
		<comments>http://blog.itsmine.co.uk/2009/01/04/yum-restore-script/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 01:05:00 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[restore]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://blog.itsmine.co.uk/?p=354</guid>
		<description><![CDATA[Ok, so I&#8217;m about to do a reinstallation of Fedora (I made a boo-boo which would be easier to fix by a re-install than go through manually and try to fix). I have backups, but not of the lib folders etc, I do however have backups of the uber important folders e.g. /etc /home /root ]]></description>
			<content:encoded><![CDATA[<p>Ok, so I&#8217;m about to do a reinstallation of Fedora (I made a boo-boo which would be easier to fix by a re-install than go through manually and try to fix). I have backups, but not of the lib folders etc, I do however have backups of the uber important folders e.g. /etc /home /root etc. Anyway, I want to do a minimum-fuss reinstall, and decided to write a wee script which would take a list of all my currently installed packages and make a nice simple exectuable bash script so that once I&#8217;ve set up the repos on the new system I can simply execute this script, it&#8217;ll install all the packages I have now, then I can just restore my /etc/directory on top and hey-presto, I&#8217;ll be back to a nicely functioning system.</p>
<p>So without further ado:</p>
<pre>#!/bin/bash

INSTALLED=/tmp/yum-installed

LIST=/tmp/list

EXECUTABLE=/home/rob/yum

USER=rob

GROUP=$USER

UNATTENDED_INSTALL=yes #yes/no

cat /dev/null &gt; $EXECUTABLE

sudo yum clean all;sudo yum list installed | awk -F' ' '{print $1}' | sed 1d | sed 1d | sed s/.i386// &amp;&gt; $INSTALLED

exec 3&lt; $INSTALLED

while read &lt;&amp;3

do

echo -n "$REPLY " &gt;&gt; $LIST

done

exec 3&gt;&amp;-

# Create the yum installation script file

if [ $UNATTENDED_INSTALL = "yes" ]

then

OPTION="-y"

fi

echo "#!/bin/bash" &gt;&gt; $EXECUTABLE

echo -n "$REPLY " &gt;&gt; $LIST

echo "sudo yum clean all;sudo yum install $OPTION `cat $LIST`" &gt;&gt; $EXECUTABLE

# Set correct perms

chmod +x $EXECUTABLE

chown $USER.$GROUP $EXECUTABLE

# Cleanup

rm -f $LIST

rm -f $INSTALLED

Obviously edit the vars at the top to suit your setup etc - then just sudo (or execute as root) the $EXECUTABLE</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.itsmine.co.uk/2009/01/04/yum-restore-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
