<?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>Vallery.net &#187; s3</title>
	<atom:link href="http://vallery.net/tag/s3/feed/" rel="self" type="application/rss+xml" />
	<link>http://vallery.net</link>
	<description>personal homepage of Jason Vallery</description>
	<lastBuildDate>Thu, 08 Apr 2010 22:45:26 +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>Automatically backup your Mac to Amazon S3</title>
		<link>http://vallery.net/2008/02/01/using-amazon-s3-to-automatically-backup-your-mac/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=using-amazon-s3-to-automatically-backup-your-mac</link>
		<comments>http://vallery.net/2008/02/01/using-amazon-s3-to-automatically-backup-your-mac/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 17:46:16 +0000</pubDate>
		<dc:creator>jvallery</dc:creator>
				<category><![CDATA[Random Thoughts]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[organize]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[s3]]></category>

		<guid isPermaLink="false">http://vallery.net/2008/02/01/using-amazon-s3-to-automatically-backup-your-mac/</guid>
		<description><![CDATA[With the new version of OS X (Leopard) Apple has included some great functionality in Time Machine. Your Mac will automatically backup to an external drive every hour. It includes the ability to recover deleted files in a timeline. The one downside to the Time Machine approach is that the data isn&#8217;t remotely stored. A [...]]]></description>
			<content:encoded><![CDATA[<p>With the new version of OS X (Leopard) Apple has included some great functionality in Time Machine.  Your Mac will automatically backup to an external drive every hour.  It includes the ability to recover deleted files in a timeline.  The one downside to the Time Machine approach is that the data isn&#8217;t remotely stored. A couple years ago my wife and I had a house fire where most of our things were destroyed.  Fortunately the fire was extinguished before it spread to where our computers were so we didn&#8217;t lose any data.  If it had been elsewhere in the house it could have been a serious situation for us if we lost all of our digital files.</p>
<p>After the fire I have followed a manual process of backing up our files on an external drive that I store in our fire safe.  The problem with this is it requires me to actually do the work, which I often put-off.  When Amazon S3 was introduced I immediately saw the potential to use it as an automatic remote backup source.  I hadn&#8217;t invested much time in it up until now, but I just got a new computer (MacBook Air!!) and while setting it up I thought it would be a good opportunity to get my backup situation in order.</p>
<p>There are some great tools already in existence that can do most of the heavy lifting for you.  The primary tool for doing remote directory syncs is called s3sync which is a script written in Ruby.  Lucky for us OS X comes with Ruby pre-installed so there isn&#8217;t much work to get it working.</p>
<p>Here is my step-by-step guide to getting your machine setup to do automatic daily backups to Amazon.  I developed these steps on my MacBook Air running Leopard however they should work for previous versions of OS X as well.</p>
<p><strong>Step 1) </strong> First off, your going to need and Amazon Web Services account.  Head over to <a href="http://aws.amazon.com/">http://aws.amazon.com/</a> and sign-up for an account to use S3.  The prices are very cheap ($0.15/GB/Month).  Once you have your account setup you will need two things to use Amazon S3. Your Amazon access key and your secret key.  These are what s3sync will use to authenticate you to Amazon.</p>
<p><strong>Step 2) </strong> I&#8217;ve packaged together a zip file with all the files you are going to need to get this setup along with SSL. Download the file at <a href="http://images.vallery.net/s3backup.zip">http://images.vallery.net/s3backup.zip</a>. You can go to <a href="http://s3sync.net/">http://s3sync.net/</a> to see if a newer version if you like but you&#8217;ll need to figure some of this out on your own.</p>
<p><strong>Step 3) </strong> You need to create a &#8220;bucket&#8221; in amazon to store your files.  A bucket is similar to a folder, however it is globally uniquely named across all Amazon S3 users.  In order to create the bucket you are going to need one of the S3 GUI applications that exist.  I have included in the zip file the one I have used called &#8220;S3 Browser&#8221;.  You can find the latest version at <a href="http://people.no-distance.net/ol/software/s3/">http://people.no-distance.net/ol/software/s3/</a>.  Once you launch S3 browser click on &#8220;connection&#8221; then &#8220;new connection&#8221;.  You&#8217;ll need to provide the access details you got from Amazon in step 1.  Once you have connected click the &#8220;Add&#8221; button which will allow you to create a new bucket.  Because the name has to be globally unique I used &#8220;vallery-macbookair-backup&#8221; where vallery is my last name.  Keep track of this bucket name because you need it in the next step.</p>
<p><img src="http://images.vallery.net/s3browser.png" alt="s3browser.png" border="0" /></p>
<p><strong>Step 4)</strong>  Once you have the zip file I created downloaded it should automatically extract itself into your downloads folder creating a new folder called &#8220;s3backup&#8221;.  Within the s3backup folder are all the files and scripts you will need in order to get this working.  There is one key file that needs to be edited in order to make this all work which is called &#8220;backup.sh&#8221;.  Open the file &#8220;backup.sh&#8221; and replace the place holder access key,  secret key, bucket name with the ones you obtained form Amazon and step 3.</p>
<p><img src="http://images.vallery.net/backupsh.png" alt="backupsh.png" border="0" /></p>
<p><strong>Step 5)</strong>  Now that you have all the files ready to go you need to select a place to store them.  The application will run as root at the system level in order to prevent file access issues,  therefore I recommend storing the entire s3backup folder in your /Library folder.  You should copy the entire folder using finder to /Library.  There are a few other paths in &#8220;backup.sh&#8221; that will need to be updated if you choose to store the file elsewhere.</p>
<p><strong>Step 6)</strong>  You need to setup your Mac to automatically run the backup shell script on a regular interval.  There are a couple ways to do this.  Since I am Unix guy I immediately started looking at cron. I discovered however that Apple recommends you use launchd for scheduled tasks.  It is fairly complex to setup a scheduled task using launchd but thankfully someone has already created a simple GUI that will let you do it.  The application Lingon can be used for this.  I&#8217;ve included the latest version at the time of writing this in the s3backup directory but you can always obtain the latest version from <a href="http://lingon.sourceforge.net/">http://lingon.sourceforge.net/</a>.  Once you have launched Lingon you need provide some information.  Click the &#8220;New&#8221; button to start a new agent.  Choose &#8220;Users Daemons&#8221; so that the script will run as root and have access to all of the users on your Mac.  Once you have created your new daemon you need to give it a name.  I recommend something like com.vallery.s3backup where vallery is your name.  You need to give the command line action for what to execute.  Again, this assumes that you have stored the s3backup folder in /Library.  Enter:  &#8220;/bin/bash /Library/s3backup/backup.sh > /dev/null&#8221;.  Lastly you need to give it a schedule as to when to run.  I have mine setup to &#8220;At a specific date&#8221; with &#8220;Every day&#8221; selected and the time set to 4:00am.  This is great if your leave your Mac on all the time.  You might select a different option so that you can make sure your Mac isn&#8217;t in use when it is doing the backup. Click the &#8220;Save&#8221; button.  It will require you to type in your admin password and then restart your computer.</p>
<p><img src="http://images.vallery.net/lingon.png" alt="lingon.png" border="0" /></p>
<p>That is it, your system should run the first backup as schedule.  It will take a long time initially as the upload speed is limited to your internet connection.  Once the initial upload has taken place it will only upload files that are new or have changed going forward.  The script is setup to backup everything in the /Users folder.  If you would like to limit what is being backed up you can change this to something else.</p>
<p>In the unfortunate event you actually need to get data out of the s3 store there are a number of applications that you can use to do this.  Initially I have been using Panic&#8217;s Transmit however it seems to have problems with the way s3sync is storing the data.  I found another great free app called &#8220;S3 Browser&#8221; which has worked well for me.  You can also use the Firefox plugin <a href="https://addons.mozilla.org/en-US/firefox/addon/3247">S3 Fox</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://vallery.net/2008/02/01/using-amazon-s3-to-automatically-backup-your-mac/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
	</channel>
</rss>
