<?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>Suse &#38; OpenSuse Tips &#187; backup</title>
	<atom:link href="http://www.susetips.com/tag/backup/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.susetips.com</link>
	<description>Tricks, Guides, Tutorials, How Tos and Troubleshooting suse linux</description>
	<lastBuildDate>Sat, 05 Jun 2010 17:55:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Differential backup script sample</title>
		<link>http://www.susetips.com/2009/05/29/differential-backup-script-sample/</link>
		<comments>http://www.susetips.com/2009/05/29/differential-backup-script-sample/#comments</comments>
		<pubDate>Fri, 29 May 2009 15:01:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[administration]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.susetips.com/2009/05/29/differential-backup-script-sample/</guid>
		<description><![CDATA[We should regularly backup our servers (and PCs and notebooks) and if you are running a production server, backing up as regularly as possible should be considered.  However, backing corporate servers which are full of emails or shared documents can take hours.  We can probably only do so on the weekends.  So, what happens when [...]<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/05/29/differential-backup-script-sample/">Differential backup script sample</a></p>
]]></description>
			<content:encoded><![CDATA[<p>We should regularly backup our servers (and PCs and notebooks) and if you are running a production server, backing up as regularly as possible should be considered.  However, backing corporate servers which are full of emails or shared documents can take hours.  We can probably only do so on the weekends.  So, what happens when we need to restore some data at the end of the work week?  Does it mean that we will loose all our data that we created or modified earlier on in the week, since we only have last week’s backup?<br />
<span id="more-162"></span><br />
<img style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" title="TDK4170" src="http://www.susetips.com/wp-content/uploads/2009/05/tdk4170.jpg" border="0" alt="TDK4170" width="320" height="278" /></p>
<p>In reality, we don’t need to do a “full” backup each time we backup our servers, we can do “differential” backups.  Differential backups are basically backups of of all the changes since the last “full” backup.  In other words, only the difference since the last “full” backup.</p>
<p>A simple script to do differential backups for users’ home directory from Monday to Thursday and full backups on a Friday is as below.</p>
<p align="left"><span style="font-family: 'Courier New'; color: #2c89a0;">#!/bin/bash<br />
if [ `date +%w` -eq 5 ] ; then<br />
if tar -cf /tmp/bck-full-`date +%F`.tar /home ; then<br />
touch /var/log/bck/last-bck<br />
tar -tf /tmp/bck-full-`date +%F`.tar &gt; \<br />
</span><span style="font-family: 'Courier New'; color: #2c89a0;"> /var/log/bck/bck-`date +%F`.log<br />
else<br />
mail -s &#8220;Backup failed&#8221; root &lt; ~<br />
fi<br />
elif [ `date +%w` -gt 0 ] &amp;&amp; [ `date +%w` -lt 5 ] ; then<br />
find /home -type f -newer /var/log/bck/last-bck | \<br />
tar -cf /tmp/bck-diff-`date +%F`.tar -T -<br />
if [ $? ] ; then<br />
tar -tf /tmp/bck-diff-`date +%F`.tar &gt; \<br />
/var/log/bck/bck-`date +%F`.log<br />
else<br />
mail -s &#8220;Backup failed&#8221; root &lt; ~<br />
fi<br />
fi</span></p>
<p>Of course, you will need to ensure that those directories used are already there and run the backups as root.  (Note, script edited to fit the width of this posting, so if you have errors, please leave a comment).<br />
<script type="text/javascript"><!--
google_ad_client = "pub-4709064562032853";
/* 300x250, created 5/8/09 */
google_ad_slot = "9311445083";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/05/29/differential-backup-script-sample/">Differential backup script sample</a></p>
<p>---<br />Related Articles at Suse &amp; OpenSuse Tips:<ul><li><a href="http://www.susetips.com/2009/05/05/automatically-dating-your-tar-backups/" rel="bookmark" title="Permanent Link: Automatically dating your tar backups">Automatically dating your tar backups</a></li><li><a href="http://www.susetips.com/2009/04/09/how-to-create-user-with-password-assigned/" rel="bookmark" title="Permanent Link: How to create user with password assigned">How to create user with password assigned</a></li><li><a href="http://www.susetips.com/2009/04/08/how-to-remove-grub-from-mbr-of-hard-drive/" rel="bookmark" title="Permanent Link: How to remove GRUB from MBR of Hard Drive">How to remove GRUB from MBR of Hard Drive</a></li><li><a href="http://www.susetips.com/2009/02/28/manually-starting-and-stopping-services-in-suseopensuse/" rel="bookmark" title="Permanent Link: Manually Starting and Stopping Services in Suse/OpenSuse">Manually Starting and Stopping Services in Suse/OpenSuse</a></li><li><a href="http://www.susetips.com/2009/04/04/tripwire-open-source-security-utility/" rel="bookmark" title="Permanent Link: Tripwire : Open Source Security Utility">Tripwire : Open Source Security Utility</a></li></ul></p><br />]]></content:encoded>
			<wfw:commentRss>http://www.susetips.com/2009/05/29/differential-backup-script-sample/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
