<?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>Spouting Shite &#187; open source</title>
	<atom:link href="http://www.spoutingshite.com/category/open-source/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.spoutingshite.com</link>
	<description>Cloud Computing isn&#039;t about technology; it&#039;s about enabling your technology led business model with lower capital investment</description>
	<lastBuildDate>Thu, 10 Jun 2010 16:02:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Backup script for a LAMP server</title>
		<link>http://www.spoutingshite.com/2009/09/03/backup-script-for-a-lamp-server/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=backup-script-for-a-lamp-server</link>
		<comments>http://www.spoutingshite.com/2009/09/03/backup-script-for-a-lamp-server/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 09:42:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[mysql backup script]]></category>
		<category><![CDATA[mysqldump]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://www.spoutingshite.com/?p=368</guid>
		<description><![CDATA[Over the years we have used several backup systems on our various IT systems. I have recently been asked by a few friends to publish these scripts. Firstly, please allow me to make a few assumptions: We want to run the backup every two hours and we want to keep 400 copies (around 17 days [...]]]></description>
			<content:encoded><![CDATA[<p>Over the years we have used several backup systems on our various IT systems. I have recently been asked by a few friends to publish these scripts.</p>
<p>Firstly, please allow me to make a few assumptions:</p>
<ol>
<li>We want to run the backup every two hours and we want to keep 400 copies (around 17 days of data)</li>
<li>We want to backup some files on the local system&#8230;.not the whole file system</li>
<li>We want to take snapshots of a database on the local system periodically</li>
<li>We will hold the backups on a remote server</li>
<li>This is a backup system of last resort, if we ever need to recover data from this system it will take manual intervention.</li>
</ol>
<p>This system is run in two steps:</p>
<p><strong><span style="text-decoration: underline;">On the local server:</span></strong></p>
<p>On the local server we want to dump the local mysql database to disk periodically, perhaps every two hours. To do this we need to follow these steps:</p>
<ol>
<li>create a directory where we will be placing the database dumps<br />
<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">/root/database_dumps</span></li>
<li><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;"> </span> create a directory where we will place our scrips<br />
<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">/root/scripts</span></li>
<li><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;"> </span>save this file into the scripts directory</li>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">#!/bin/sh</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># Script name : auto_mysql_dump.sh</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># Backup the dbname database</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">date=`date +%F-%k.%M.%S`</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">DBS=`mysql -Bse &#8216;show databases&#8217;`</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">for db in $DBS</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">do</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">mysqldump &#8211;databases $db &gt; /root/database_dumps/$db-$date.sql</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">done</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">cd /root/database_dumps</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">tar -czf mysqldump-$date.tar.gz *.sql</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">rm -fr *.sql</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># delete all database entries that are more than 2 day old</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">find /root/database_dumps/ -amin +300 -exec /bin/rm -f {} \;</div>
<pre style="padding-left: 60px;">#!/bin/sh
# Script name : mysql_dump.sh
# Backup the dbname database
# Script created by Ross Cooney from Rozmic (www.emailcloud.com)

USER='your-mysql-username'
PASS='your-mysql-password' 

date=`date +%F-%H.%M.%S`
DBS=`mysql -u $USER -p$PASS -Bse 'show databases'`

for db in $DBS
do
       mysqldump -u $USER -p$PASS --databases $db &gt; /root/database_dumps/$db-$date.sql
done

cd /root/database_dumps
tar -czf mysqldump-$date.tar.gz *.sql
rm -fr *.sql</pre>
<pre style="padding-left: 60px;"># delete all database entries that are more than 3 hours old
find /root/database_dumps/ -amin +180 -exec /bin/rm -f {} \;</pre>
<li>setup the following cron job:<br />
<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace;"><span style="line-height: 18px; white-space: pre;">0 1,3,5,7,9,11,13,15,17,19,21,23 * * * /root/scripts/mysql_dump.sh  &gt; /dev/null</span></span></li>
</ol>
<p>These four steps will setup a process that dumps the mysql database to disk every two hours and then hold a copy of that database dump for three hours.</p>
<p><span style="text-decoration: underline;"><strong>On the remote server:</strong></span></p>
<p>We want to run a script every two hours to copy the changes of any files on the disk. To do this you need to follow these steps:</p>
<ol>
<li>create a directory where we will be placing the backup files<br />
<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre; ">/root/backup</span></li>
<li>Create a directory that we will use for this particular block of data, we use the IP address of the server but you can use anything that you want.<br />
<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre; ">/root/backup/10.0.0.6</span></li>
<li><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre; "><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px; white-space: normal; font-size: 13px; ">create a directory where we will place our scrips<br />
<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre; ">/root/scripts</span></span></span></li>
<li>Ensure that the SSH key for the remote server is listed in the local server&#8217;s &#8216;authorized_keys&#8217; file so that ssh connections can be made without needing a password.</li>
<li>Save this file to your scripts directory:</li>
<pre style="padding-left: 90px;">#!/bin/bash
# this script is called: 10.0.0.6.backup.sh
# Script created by Ross Cooney from Rozmic (www.emailcloud.com)</pre>
<pre style="padding-left: 90px;">RSYNC_ARGS="-az --progress --delete --delete-excluded --delete-after"
BACKUP_DIRS="/var/www/html /etc /root/scripts /root/database_dumps"
SERVER="10.0.0.6"
DIR="/root/backup/10.0.0.6"</pre>
<pre style="padding-left: 90px;"> rm -rf $DIR/daily.400</pre>
<pre style="padding-left: 90px;"> for i in `seq 400 -1  1`; do
        let NEXT=$i+1
        mv $DIR/daily.$i $DIR/daily.$NEXT &gt; /dev/null 2&gt;&amp;1
done</pre>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: small;"> </span></p>
<pre style="padding-left: 90px;">cp -al $DIR/daily.0 $DIR/daily.1

for RDIR in $BACKUP_DIRS; do
   rsync $RSYNC_ARGS ${SERVER}:$RDIR $DIR/$HOST/daily.0/
done</pre>
<li>Setup the following cron job:<br />
<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">0 0,2,4,6,8,10,12,14,16,18,20,22 * * * /root/scripts/backup.10.0.0.6.sh &gt; /dev/null</span></li>
</ol>
<p>These scripts work for us, I hope that they are of value to you, please dont take my word for their effectiveness, you should test them fully before you use them. I used the following resources when I was writing these scripts:</p>
<ul>
<li><a href="http://www.mikerubel.org/computers/rsync_snapshots/"><span style="color: #000000;"><span style="text-decoration: none;"><span style="color: #000000;"><span style="text-decoration: none;"><span style="color: #000000;"><span style="text-decoration: none;">http://www.mikerubel.org/computers/rsync_snapshots/</span></span></span></span></span></span></a></li>
<li><span style="color: #000000;"><span style="text-decoration: none;"><span style="color: #000000;"><span style="text-decoration: none;"><span style="color: #000000;"><span style="text-decoration: none;"><a href="http://bash.cyberciti.biz/backup/backup-mysql-database-server-2/">http://bash.cyberciti.biz/backup/backup-mysql-database-server-2/</a></span></span></span></span></span></span></li>
</ul>
<p>Update (2nd October 2009):<br />
Thanks to <a href="http://www.coldclimate.co.uk/">Oli Wood</a> for pointing out the typo in the above script, this has now been resolved <img src='http://www.spoutingshite.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.spoutingshite.com%2F2009%2F09%2F03%2Fbackup-script-for-a-lamp-server%2F&amp;linkname=Backup%20script%20for%20a%20LAMP%20server"><img src="http://www.spoutingshite.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.spoutingshite.com/2009/09/03/backup-script-for-a-lamp-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Powershell, Drupal and market analysis, yep, SuperMondays is back!</title>
		<link>http://www.spoutingshite.com/2009/02/16/powershell-drupal-and-market-analysis-yep-supermondays-is-back/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=powershell-drupal-and-market-analysis-yep-supermondays-is-back</link>
		<comments>http://www.spoutingshite.com/2009/02/16/powershell-drupal-and-market-analysis-yep-supermondays-is-back/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 10:23:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[beehive]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[newcastle]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[supermondays]]></category>

		<guid isPermaLink="false">http://www.spoutingshite.com/?p=170</guid>
		<description><![CDATA[The next SuperMondays event is booked for the 23rd February at the usual place (the Beehive Research Facility in Newcastle University). You can find a map here: http://tinyurl.com/czs4dp The speakers this month will be: Jonathan Noble — Microsoft Windows PowerShell, an introduction Microsoft released Windows PowerShell in 2006 to finally give Windows a decent shell and scripting [...]]]></description>
			<content:encoded><![CDATA[<p>The next SuperMondays event is booked for the 23rd February at the usual place (the Beehive Research Facility in Newcastle University). You can find a map here:<br />
<a rel="nofollow" href="http://tinyurl.com/czs4dp">http://tinyurl.com/czs4dp</a></p>
<p>The speakers this month will be:</p>
<ul>
<li><strong>Jonathan Noble — Microsoft Windows PowerShell, an introduction<br />
</strong>Microsoft released Windows PowerShell in 2006 to finally give Windows a decent shell and scripting language for automation and PowerShell V2 will come installed and on by default in the forthcoming releases of Windows 7 and Server 2008 R2. Jonathan will give an overview of PowerShell and explain why it’s not just of interest to Windows sys admins.</li>
<li><strong>Jonathan Bradford: Online, Offline?</strong><br />
A new generation of applications are emerging which will bring “online” applications to “offline” situations.  What might they look like? And how will they be built?</li>
<li><span><span><strong>Mike Parker </strong></span></span><span><span><strong>–</strong></span></span><span><span><strong> Rapid web app development using Drupal as the Framework.</strong><br />
Mike will give an insight into how quickly you can build an app and how you may go about doing it.</span></span></li>
</ul>
<div>We also hope that Craig Rothwell from the OpenPandora project will be able to bring along a demo unit to show.</div>
<p>The event is in the Beehive at Newcastle University and starts at 18:00.</p>
<p> </p>
<div>You can signup here:</div>
<div><a href="http://upcoming.yahoo.com/event/1537376">http://upcoming.yahoo.com/event/1537376</a></div>
<p> </p>
<div>Please tweet, blog and generally pass on the news.</div>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.spoutingshite.com%2F2009%2F02%2F16%2Fpowershell-drupal-and-market-analysis-yep-supermondays-is-back%2F&amp;linkname=Powershell%2C%20Drupal%20and%20market%20analysis%2C%20yep%2C%20SuperMondays%20is%20back%21"><img src="http://www.spoutingshite.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.spoutingshite.com/2009/02/16/powershell-drupal-and-market-analysis-yep-supermondays-is-back/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Proprietary software is often more expensive than the open source alternative</title>
		<link>http://www.spoutingshite.com/2009/01/28/proprietary-software-is-often-more-expensive-than-the-open-source-alternative/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=proprietary-software-is-often-more-expensive-than-the-open-source-alternative</link>
		<comments>http://www.spoutingshite.com/2009/01/28/proprietary-software-is-often-more-expensive-than-the-open-source-alternative/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 09:31:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[vendor independence]]></category>

		<guid isPermaLink="false">http://www.spoutingshite.com/?p=159</guid>
		<description><![CDATA[This week I was asked why felt that it was expensive to use proprietary software. While the following line of thought will not be new to anybody who is involved in the open source community I felt that perhaps it might be useful for others to read. I think &#8216;cost&#8217; for a student is measured in [...]]]></description>
			<content:encoded><![CDATA[<p>This week I was asked why felt that it was expensive to use proprietary software. While the following line of thought will not be new to anybody who is involved in the open source community I felt that perhaps it might be useful for others to read.</p>
<p>I think &#8216;cost&#8217; for a student is measured in £££, which is important, but, as a business owner and a developer I think that time often is more important than £££. </p>
<p>Open source software is a low cost alternative to proprietary software.  For example, the Linux operating system is a low cost alternative to the Microsoft Server 2003 operating system. This popularity is very evident when you see that today the largest market share for web servers is held by the open source Apache system (<a href="http://news.netcraft.com/archives/web_server_survey.html ">51% market share</a>). Many think that the key advantage of open source software is its low cost of ownership. I believe that this is not the case. </p>
<p>As a business owner I see other advantages, namely: </p>
<ul>
<li>Lower total cost of ownership </li>
<li>Reduced dependence on software vendors </li>
<li>Easier to customize </li>
<li>Higher level of security </li>
</ul>
<p>By far, the most important thing that open source software gives me is independence. I really value my vendor independence. This includes independence from the vendor for maintenance, support and the <br />
necessity accept version upgrades that I do not want or need. </p>
<p>For example, when Microsoft releases a new operating system it usually phases out support for older versions. This would force me to upgrade the OS on our network, even if we felt that we didn&#8217;t need the update. In contrast, there is no forced upgrade cycle with open source. Older versions of open source products continue to be supported through the open source community and third party support providers as long as there is demand in the marketplace for such support. </p>
<p>I am not a Microsoft basher, we do use Microsoft products on our network. We use WinXP on all internal desktops with Office and Micorsoft Exchange on our internal network. But it would be very unlikely that I would use it on may of <a href="http://www.emailcloud.com">our scan network</a>.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.spoutingshite.com%2F2009%2F01%2F28%2Fproprietary-software-is-often-more-expensive-than-the-open-source-alternative%2F&amp;linkname=Proprietary%20software%20is%20often%20more%20expensive%20than%20the%20open%20source%20alternative"><img src="http://www.spoutingshite.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.spoutingshite.com/2009/01/28/proprietary-software-is-often-more-expensive-than-the-open-source-alternative/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
