<?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/"
		xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>Pragmatic Revelations &#187; bash</title>
	<atom:link href="http://adrianhoe.com/adrianhoe/tag/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://adrianhoe.com/adrianhoe</link>
	<description>The Eccentric Logic of An Eclectic Mind</description>
	<lastBuildDate>Sun, 27 Nov 2011 04:24:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<copyright>Copyright &#xA9; Pragmatic Revelations 2011 </copyright>
	<managingEditor>mailbox@adrianhoe.com (Pragmatic Revelations)</managingEditor>
	<webMaster>mailbox@adrianhoe.com (Pragmatic Revelations)</webMaster>
	<ttl>28000</ttl>
	<image>
		<url>http://adrianhoe.com/adrianhoe/blog/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
		<title>Pragmatic Revelations</title>
		<link>http://adrianhoe.com/adrianhoe</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle></itunes:subtitle>
	<itunes:summary>The Eccentric Logic of An Eclectic Mind</itunes:summary>
	<itunes:keywords></itunes:keywords>
	<itunes:category text="Society &#38; Culture" />
	<itunes:author>Pragmatic Revelations</itunes:author>
	<itunes:owner>
		<itunes:name>Pragmatic Revelations</itunes:name>
		<itunes:email>mailbox@adrianhoe.com</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://adrianhoe.com/adrianhoe/blog/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<item>
		<title>Automated backup</title>
		<link>http://adrianhoe.com/adrianhoe/2009/09/30/automated-backup/</link>
		<comments>http://adrianhoe.com/adrianhoe/2009/09/30/automated-backup/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 04:48:34 +0000</pubDate>
		<dc:creator>Adrian Hoe</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Call Me a Geek]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[scp]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://adrianhoe.com/adrianhoe/?p=1835</guid>
		<description><![CDATA[Since August 18, my software development work has been picking up its pace and I have checked in more works more often, at least five times on single productive day. Ever since, I have been manually backing up Subversion directory using tar. My project server is fornax. Fornax is a 6-year old PC running Ubuntu. [...]]]></description>
			<content:encoded><![CDATA[<p>Since August 18, my software development work has been picking up its pace and I have checked in more works more often, at least five times on single productive day. Ever since, I have been manually backing up Subversion directory using tar. My project server is fornax.</p>
<p>Fornax is a 6-year old PC running Ubuntu. It wasn&#8217;t working properly due to the cooling fan in its power supply unit. Until about two weeks ago, I replaced the old fan. I am not very confident about the replacement because it is a third party part and the replacement isn&#8217;t as good as expected, but it works. I have to shut it down every night before going to bed.</p>
<p>So, the last thing before I go to bed is to backup the svn directory and then shutdown the server. I am quite fed up with this extra manual works. Last night, before going to bed, I decided to automate this process. And I did it this morning.</p>
<p>I wrote a simple bash shell script to do the backup. I <span style="font-family:Courier;">cron</span> it so that the process will start automatically at 2300 hours and then shutdown.</p>
<pre><code>
#!/bin/bash

BACKUPFILE=/tmp/backups/svn-$(date +%Y%m%d).tar.gz

rm /tmp/backups/svn-*.gz
tar -cj /svn &gt; $BACKUPFILE
for COMPUTER in host1 host2
do
   scp $BACKUPFILE user@$COMPUTER:Desktop/
done
/sbin/shutdown -h +5
</code></pre>
<p><strong>UPDATE (05/10/2009)</strong>: I setup a password-less <span style="font-family:Courier;">ssh</span> login so that no password is required for <span style="font-family:Courier;">scp</span> (secured copy). Now, after the backup, the backup file will be copied automatically to two other computers for safe keeping.</p>
]]></content:encoded>
			<wfw:commentRss>http://adrianhoe.com/adrianhoe/2009/09/30/automated-backup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

