<?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>Felipe Alfaro Solana &#187; Backup</title>
	<atom:link href="http://www.felipe-alfaro.org/blog/category/backup/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.felipe-alfaro.org/blog</link>
	<description>A little bit of technology, security and networking with Linux, FreeBSD and Mac OS X, plus some personal opinions.</description>
	<lastBuildDate>Sun, 23 Oct 2011 16:46:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Amazon S3? Not yet ready for me!</title>
		<link>http://www.felipe-alfaro.org/blog/2009/03/15/amazon-s3-not-yet-ready-for-me/</link>
		<comments>http://www.felipe-alfaro.org/blog/2009/03/15/amazon-s3-not-yet-ready-for-me/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 17:44:01 +0000</pubDate>
		<dc:creator>Felipe Alfaro Solana</dc:creator>
				<category><![CDATA[Backup]]></category>
		<category><![CDATA[Rsync]]></category>

		<guid isPermaLink="false">http://www.felipe-alfaro.org/blog/?p=279</guid>
		<description><![CDATA[I&#8217;ve been thinking for a while how to properly keep back-ups of all of my data while, at the same time, saving a few bucks. Since the &#8220;cloud computing&#8221; term is now floating all over the Internet, I thought that a distributed, remote back-up service might do the work for me. I looked around and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been thinking for a while how to properly keep back-ups of all of my data while, at the same time, saving a few bucks. Since the &#8220;cloud computing&#8221; term is now floating all over the Internet, I thought that a distributed, remote back-up service might do the work for me.</p>
<p>I looked around and found quite different services, but most of them offer ridiculously small storage size, like 5GB, or force me into using sub-par Web-based user interfaces that make using <a href="http://samba.anu.edu.au/rsync/">rsync</a> complicated or unfeasible. I&#8217;m looking services that offer 2TB+ storage and, so far, the only solution that I find promising is Amazon S3. The problem is price. Keeping 2,048GB of data stored in Amazon S3 costs me about $300 USD per month, plus a one-time cost for uploading the data. At that price, for a whole year, I can buy a QNAP TS-809 filled with 8 x 1.5TB disks <img src='http://www.felipe-alfaro.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So, unfortunately for me, multi-terabyte back-up copies to the Internet are still to expensive. Perhaps, in 5 years, technology will drive prices down such as that I can afford to keep my back-ups on the Internet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.felipe-alfaro.org/blog/2009/03/15/amazon-s3-not-yet-ready-for-me/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Incremental backups with rsync</title>
		<link>http://www.felipe-alfaro.org/blog/2005/09/09/incremental-backups-with-rsync/</link>
		<comments>http://www.felipe-alfaro.org/blog/2005/09/09/incremental-backups-with-rsync/#comments</comments>
		<pubDate>Fri, 09 Sep 2005 02:01:59 +0000</pubDate>
		<dc:creator>Felipe Alfaro Solana</dc:creator>
				<category><![CDATA[Backup]]></category>
		<category><![CDATA[Rsync]]></category>

		<guid isPermaLink="false">http://felipe-alfaro.org/blog/?p=57</guid>
		<description><![CDATA[I have been thinking for a while to implement incremental, cyclical backups on my home network. The problem with cyclical backups to tape is that they are slow. The problem with cyclical backups to disk is that they consume a great deal of space. I finally opted for cyclical backups to disk since my DDS-3 [...]]]></description>
			<content:encoded><![CDATA[<p>I have been thinking for a while to implement incremental, cyclical backups on my home network. The problem with cyclical backups to tape is that they are slow. The problem with cyclical backups to disk is that they consume a great deal of space. I finally opted for cyclical backups to disk since my DDS-3 SCSI tape is slow and can&#8217;t hold the many gigabytes I have in data, even with hardware/software compression.</p>
<p>I want to periodically branch my main backup tree so that I can keep several backups, ordered from the newest (backup.0) to the oldest (backup.n), where &#8220;n&#8221; could be the number of days or weeks, depending on the frequency of the backups.</p>
<p>The filesystem should look like this:</p>
<pre>\-- backup.0
 |
 |- backup.1
 |
 |- backup.2
 |
 .
 .
 .
 \- backup.n</pre>
<p>A simple way to reduce disk space usage is by using a UNIX-like feature called hard-links. The idea behind this is that if a file does not see its contents changed between backups, we could save space by having all the identical copies hard-linked together.</p>
<p>Using <b>rsync</b> and <b>cp</b> we can implement this very easily, thanks to the way that <em>rsync</em> works. By default, when not using the <em>&#8211;inplace</em> command-line switch, if <em>rsync</em> detects that a destination file is different from its source file, instead of performing direct modifications onto the destination file by opening it, writing to it, then closing it, <em>rsync</em> will create a new file. This has several advantages:</p>
<ol>
<li>Users can keep on working with files, even when <em>rsync</em> is synching them underneath. Since <em>rsync</em> always creates a new file instead of performing modifications to the current file, users won&#8217;t suffer from the strangeness that involves multiple updates to the same file by multiple users/processes.</li>
<li>Since <em>rsync</em> creates a new file, when the original destination file is hard-linked across several backup branches, the synching process won&#8217;t indirectly sync up those backup branches too. Instead, they will be kept intact, and a new destination file, mirroring its source file, will be created.
<p>We don&#8217;t want that an update to a file in the backup.0 branch means updating any file hard-linked to it, since that would destroy the incremental semantics.</li>
</ol>
<p>Thus, we can implement a really simple cyclical backup scheme using <em>rsync</em> and hard-links..</p>
<ol>
<li>
<h4>Things to run on the server.</h4>
<p>We run this periodically:</p>
<pre># rm -fr backup.${n}
# for i in `seq ${n} -1 2`; do mv backup.$[${i}-1] backup.${i}; done
# cp -al backup.0 backup.1</pre>
<p>This will rotate all the backups, discarding the last one. Then, the <b>cp</b> command will replicate the main branch (<b>backup.0</b>) into (<b>backup.1</b>) by using hard-links.</p>
<p><b>NOTE for FreeBSD users:</b> the <em>cp</em> command that comes with the FreeBSD base system does not support neither the <em>-a</em> nor the <em>-l</em> command-line switches. <em>-a</em> means <em>-dpR</em> (recursively copy and preserve attributes), while <em>-l</em> means not to copy, but to create hard-links instead.</p>
<p>Fortunately, the FreeBSD ports collection includes a port of the GNU coreutils package, which sports the full <em>GNU cp</em> program, supporting the <em>-a</em> and <em>-l</em> switches:</p>
<pre># cd /usr/ports/sysutils/coreutils
# make all install</pre>
<p>To avoid the name clashing betweeh the <em>cp</em> command from the FreeBSD system and the GNU one, the GNU <em>cp</em> command is renamed to <b>gcp</b>. So, in the script listed bedore, we should rename the invocation to <em>cp</em> to <em>gcp</em>.</li>
<li>
<h4>Things to run on the client.</h4>
<p>To perform the incremental backup against the server, we can run the following command:</p>
<pre># rsync -a -E Users/ rsync://<rsync -server>:/data/backup.0/</rsync></pre>
<p>It&#8217;s very important to keep the timestamps synchronized on both the client and the server so rsync can use them to decide which files have been changed and which files not. This is done with the <b>-t</b> command-line switch. Note that the <b>-a</b> (archive) command-line switch to <em>rsync</em> is like specifying <em>-rlptgoD</em>, and thus we don&#8217;t have to specify <em>-t</em>.</p>
<p>The <b>-E</b> command-line switch is useful for Mac OS X-based machines and will allow synching files stored in a HFS+ volume that uses resource forks by using the AppleDouble format.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.felipe-alfaro.org/blog/2005/09/09/incremental-backups-with-rsync/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Backup fails with an error message when trying to perform a backup</title>
		<link>http://www.felipe-alfaro.org/blog/2005/08/17/backup-fails-with-an-error-message-when-trying-to-perform-a-backup/</link>
		<comments>http://www.felipe-alfaro.org/blog/2005/08/17/backup-fails-with-an-error-message-when-trying-to-perform-a-backup/#comments</comments>
		<pubDate>Tue, 16 Aug 2005 19:05:33 +0000</pubDate>
		<dc:creator>Felipe Alfaro Solana</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://felipe-alfaro.org/blog/2005/08/17/backup-fails-with-an-error-message-when-trying-to-perform-a-backup/</guid>
		<description><![CDATA[iBackup has problems backing up folders to iDisk if those folders&#8217; icons have been customized. BRIEF: It&#8217;s a problem caused by folders with customized icons. DETAILED: Sometime ago, I customized the icons for the &#8220;Library&#8221; and &#8220;Documents&#8221; folders as I didn&#8217;t like the default ones &#8211; I took the icons from the wonderful World of [...]]]></description>
			<content:encoded><![CDATA[<p>iBackup has problems backing up folders to iDisk if those folders&#8217; icons have been customized.</p>
<p><b>BRIEF:</b> It&#8217;s a problem caused by folders with customized icons.</p>
<p><b>DETAILED:</b> Sometime ago, I customized the icons for the &#8220;Library&#8221; and &#8220;Documents&#8221; folders as I didn&#8217;t like the default ones &#8211; I took the icons from the wonderful World of Aqua set of icons. When you customize the icon of a folder, a zero-sized file named &#8220;Icon?&#8221; (or Icon^M when viewed from the command line) is created inside that folder.</p>
<p>It seems that iBackup doesn&#8217;t cope well with this kind of files, at least when backing up to the iDisk. When the folders being backed up have a customized icon (a file named Icon?), iBackup will complain with the following error message:</p>
<p><i>&#8220;/Users/falfaro/<folder>/Icon&#8221; not found on iDisk. This file does not exist on the iDisk.</folder></i></p>
<p><b>SOLUTION:</b> Remove the offending &#8220;Icon?&#8221; file from the folder in question and then retry the operation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.felipe-alfaro.org/blog/2005/08/17/backup-fails-with-an-error-message-when-trying-to-perform-a-backup/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

