<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Automatic Command Archive</title>
	<atom:link href="http://blog.sriunplugged.com/shell-scripting/automatic-command-archive/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sriunplugged.com/shell-scripting/automatic-command-archive/</link>
	<description>The place where I share my experiments on my computer</description>
	<lastBuildDate>Fri, 03 Feb 2012 13:30:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: louis vuitton ankle boots</title>
		<link>http://blog.sriunplugged.com/shell-scripting/automatic-command-archive/comment-page-1/#comment-487</link>
		<dc:creator>louis vuitton ankle boots</dc:creator>
		<pubDate>Mon, 06 Sep 2010 08:39:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sriunplugged.com/?p=4#comment-487</guid>
		<description>Your site is amazing.I am very impressed to see this,i want to come back for visiting your site.Keep doing Good as well as you can..</description>
		<content:encoded><![CDATA[<p>Your site is amazing.I am very impressed to see this,i want to come back for visiting your site.Keep doing Good as well as you can..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sarath</title>
		<link>http://blog.sriunplugged.com/shell-scripting/automatic-command-archive/comment-page-1/#comment-2</link>
		<dc:creator>Sarath</dc:creator>
		<pubDate>Wed, 10 Sep 2008 09:19:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sriunplugged.com/?p=4#comment-2</guid>
		<description>Hey!&lt;br/&gt;KISS -&gt; Keep it simple and Stupid. :D&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;#!/bin/bash&lt;br/&gt;#Filename : storehist.sh&lt;br/&gt;#Description: History storage script &lt;br/&gt;&lt;br/&gt;size=`cat ~/.bash_history &#124; wc -l`;&lt;br/&gt;&lt;br/&gt;function dup_remove()&lt;br/&gt;{&lt;br/&gt; cat -n $1 &#124; sort -urk2 &#124; sort -n &#124; cut -f2;&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;mkdir -p ~/.logs/archive;&lt;br/&gt;&lt;br/&gt;if [ $size -gt 400 ];&lt;br/&gt;then&lt;br/&gt; echo &quot;History log sent to ~/.logs/history :$(date)&quot;;&lt;br/&gt;&lt;br/&gt; dup_remove ~/.bash_history &gt;/tmp/history.$$;&lt;br/&gt; cat /tmp/history.$$ &gt;&gt; ~/.logs/history;&lt;br/&gt; cat /tmp/history.$$ &#124; tail -n 400 &gt; ~/.bash_history;&lt;br/&gt;fi;&lt;br/&gt;&lt;br/&gt;if [[ `du -sh ~/.logs/history` =~ &quot;M&quot; ]];&lt;br/&gt;then&lt;br/&gt;&lt;br/&gt; echo &quot;Archived on `date`&quot;;&lt;br/&gt; dup_remove ~/.logs/history &gt; /tmp/history.$$;&lt;br/&gt; cat /tmp/history.$$ &gt; ~/.logs/history;&lt;br/&gt; gzip -c ~/.logs/history &gt; ~/.logs/archive/$(date);&lt;br/&gt; &gt; ~/.logs/history;&lt;br/&gt;fi;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;#crontab entry as:&lt;br/&gt;* */1 * * * storehist.sh</description>
		<content:encoded><![CDATA[<p>Hey!<br />KISS -&gt; Keep it simple and Stupid. <img src='http://blog.sriunplugged.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>#!/bin/bash<br />#Filename : storehist.sh<br />#Description: History storage script </p>
<p>size=`cat ~/.bash_history | wc -l`;</p>
<p>function dup_remove()<br />{<br /> cat -n $1 | sort -urk2 | sort -n | cut -f2;<br />}</p>
<p>mkdir -p ~/.logs/archive;</p>
<p>if [ $size -gt 400 ];<br />then<br /> echo &quot;History log sent to ~/.logs/history :$(date)&quot;;</p>
<p> dup_remove ~/.bash_history &gt;/tmp/history.$$;<br /> cat /tmp/history.$$ &gt;&gt; ~/.logs/history;<br /> cat /tmp/history.$$ | tail -n 400 &gt; ~/.bash_history;<br />fi;</p>
<p>if [[ `du -sh ~/.logs/history` =~ &quot;M&quot; ]];<br />then</p>
<p> echo &quot;Archived on `date`&quot;;<br /> dup_remove ~/.logs/history &gt; /tmp/history.$$;<br /> cat /tmp/history.$$ &gt; ~/.logs/history;<br /> gzip -c ~/.logs/history &gt; ~/.logs/archive/$(date);<br /> &gt; ~/.logs/history;<br />fi;</p>
<p>#crontab entry as:<br />* */1 * * * storehist.sh</p>
]]></content:encoded>
	</item>
</channel>
</rss>

