<?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>gilesthomas.com &#187; NSLU2 offsite backup project</title>
	<atom:link href="http://www.gilesthomas.com/?feed=rss2&#038;cat=4" rel="self" type="application/rss+xml" />
	<link>http://www.gilesthomas.com</link>
	<description>Tech notes</description>
	<lastBuildDate>Tue, 24 Aug 2010 15:06:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Project: Automated offsite backups for an NSLU2 &#8211; part 13</title>
		<link>http://www.gilesthomas.com/?p=20</link>
		<comments>http://www.gilesthomas.com/?p=20#comments</comments>
		<pubDate>Fri, 17 Nov 2006 01:01:59 +0000</pubDate>
		<dc:creator>giles</dc:creator>
				<category><![CDATA[NSLU2 offsite backup project]]></category>

		<guid isPermaLink="false">http://www.gilesthomas.com/?p=20</guid>
		<description><![CDATA[Previously in this series: Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part 13.
I&#8217;m setting up automated offsite backups from my NSLU2 to Amazon S3.  With suprisingly little effort, I&#8217;ve managed to get a tool called s3sync running on the [...]]]></description>
			<content:encoded><![CDATA[<p>Previously in this series: <a href="http://www.gilesthomas.com/?p=5">Part 1</a>, <a href="http://www.gilesthomas.com/?p=6">Part 2</a>, <a href="http://www.gilesthomas.com/?p=7">Part 3</a>, <a href="http://www.gilesthomas.com/?p=8">Part 4</a>, <a href="http://www.gilesthomas.com/?p=9">Part 5</a>, <a href="http://www.gilesthomas.com/?p=10">Part 6</a>, <a href="http://www.gilesthomas.com/?p=11">Part 7</a>, <a href="http://www.gilesthomas.com/?p=12">Part 8</a>, <a href="http://www.gilesthomas.com/?p=14">Part 9</a>, <a href="http://www.gilesthomas.com/?p=15">Part 10</a>, <a href="http://www.gilesthomas.com/?p=16">Part 11</a>, <a href="http://www.gilesthomas.com/?p=16">Part 13</a>.</p>
<p>I&#8217;m setting up automated offsite backups from my <a href="http://www.linksys.com/servlet/Satellite?c=L_Product_C2&#038;childpagename=US%2FLayout&#038;cid=1115416906769&#038;pagename=Linksys%2FCommon%2FVisitorWrapper">NSLU2</a> to <a href="http://aws.amazon.com/s3">Amazon S3</a>.  With suprisingly little effort, I&#8217;ve managed to get a tool called <a href="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=11975&#038;start=0&#038;tstart=0">s3sync</a> running on the &#8220;slug&#8221; (as it&#8217;s known).  s3sync is a Ruby script, so in order to run it, I had to install <a href="http://www.ruby-lang.org/en/">Ruby</a>, which in turn meant that I had to <a href="http://www.gilesthomas.com/?p=11">replace</a> the slug&#8217;s firmware with a different version of Linux, called <a href="http://www.nslu2-linux.org/wiki/Unslung/HomePage">Unslung</a>.  Once all of this was done, I <a href="http://www.gilesthomas.com/?p=16">just had to</a> set up the appropriate directory structures and certificates so that the sync tool could use SSL, and write a simple upload/download script.  All of this worked pretty much as advertised in the tools&#8217; respective documentation &#8211; for the details, see the previous posts in this series.  </p>
<p>My final step had been to set up a cron job to run the upload script, but it had failed, not logging anything.  In order to debug, I ran the upload script directly from the command line, and left it to run overnight, copying a large set of directories to S3.</p>
<p>13 hours later, it had completed.  From the <a href="https://jets3t.dev.java.net/cockpit.html">jet3St Cockpit</a>, I checked how much data was present in the bucket; it told me I had 1.61Gb, split over 2774 items.  This seemed a little on the low side, but I had to get back to my workstation to be sure.  And there, the same program told me that I had 1.71Gb, split over 2770 items.  Checking the console showed that the command had, it thought, succeeded with no errors &#8211; but and the directory that was meant to be synced claimed to be about 4Gb in size!</p>
<p>A quick investigation showed that there were certainly files missing from S3.  I decided to see what would happen if I ran it again &#8211; would it start uploading where it left off?  </p>
<p>I suspect sorting this problem out may take a certain amount of poking around over a number of days, so I won&#8217;t post again in this series until I&#8217;ve found the solution.</p>
<p>[Update] Still hard at work on this; it looks like there&#8217;s a problem with s3sync making it cut out after some amount of transfer, so I&#8217;m trying to diagnose the problem &#8211; which is tricky when each exeperiment takes 24 hours :-/   Final results will be posted here when I have them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gilesthomas.com/?feed=rss2&amp;p=20</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project: Automated offsite backups for an NSLU2 &#8211; part 12</title>
		<link>http://www.gilesthomas.com/?p=18</link>
		<comments>http://www.gilesthomas.com/?p=18#comments</comments>
		<pubDate>Thu, 16 Nov 2006 00:50:41 +0000</pubDate>
		<dc:creator>giles</dc:creator>
				<category><![CDATA[NSLU2 offsite backup project]]></category>

		<guid isPermaLink="false">http://www.gilesthomas.com/?p=18</guid>
		<description><![CDATA[Previously in this series: Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11.
I&#8217;m setting up automated offsite backups from my NSLU2 to Amazon S3.  With suprisingly little effort, I&#8217;ve managed to get a tool called s3sync running on the &#8220;slug&#8221; (as [...]]]></description>
			<content:encoded><![CDATA[<p>Previously in this series: <a href="http://www.gilesthomas.com/?p=5">Part 1</a>, <a href="http://www.gilesthomas.com/?p=6">Part 2</a>, <a href="http://www.gilesthomas.com/?p=7">Part 3</a>, <a href="http://www.gilesthomas.com/?p=8">Part 4</a>, <a href="http://www.gilesthomas.com/?p=9">Part 5</a>, <a href="http://www.gilesthomas.com/?p=10">Part 6</a>, <a href="http://www.gilesthomas.com/?p=11">Part 7</a>, <a href="http://www.gilesthomas.com/?p=12">Part 8</a>, <a href="http://www.gilesthomas.com/?p=14">Part 9</a>, <a href="http://www.gilesthomas.com/?p=15">Part 10</a>, <a href="http://www.gilesthomas.com/?p=16">Part 11</a>.</p>
<p>I&#8217;m setting up automated offsite backups from my <a href="http://www.linksys.com/servlet/Satellite?c=L_Product_C2&#038;childpagename=US%2FLayout&#038;cid=1115416906769&#038;pagename=Linksys%2FCommon%2FVisitorWrapper">NSLU2</a> to <a href="http://aws.amazon.com/s3">Amazon S3</a>.  With suprisingly little effort, I&#8217;ve managed to get a tool called <a href="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=11975&#038;start=0&#038;tstart=0">s3sync</a> running on the &#8220;slug&#8221; (as it&#8217;s known).  s3sync is a Ruby script, so in order to run it, I had to install <a href="http://www.ruby-lang.org/en/">Ruby</a>, which in turn meant that I had to <a href="http://www.gilesthomas.com/?p=11">replace</a> the slug&#8217;s firmware with a different version of Linux, called <a href="http://www.nslu2-linux.org/wiki/Unslung/HomePage">Unslung</a>.  Once all of this was done, I <a href="http://www.gilesthomas.com/?p=16">just had to</a> set up the appropriate directory structures and certificates so that the sync tool could use SSL, and write a simple upload/download script.  All of this worked pretty much as advertised in the tools&#8217; respective documentation &#8211; for the details, see the previous posts in this series.  </p>
<p>My final step in my last post was to set up a cron job to synchronise quite a lot of data up to S3 overnight; here is the line from the crontab file:</p>
<pre>
42 22 * * * root /home/s3sync/upload.sh &#038;> /tmp/s3sync.log
</pre>
<p>Checking this morning brought some bad news.  Nothing had been written to the log file, and the bucket I&#8217;d set up to receive the backup on S3 had only 6Mb of data &#8211; as compared to a total of 4Gb+ that was there to be backed up.</p>
<p>Clearly something had gone wrong.</p>
<p>I figured it was best to try again, this time trying to eliminate whatever problem had occurred with the cron job by simply running the backup script from a command prompt.  After all, I had run the script from a command line previously, and had seen some useful logging information.</p>
<p>This time it at least seemed to be logging something:</p>
<pre>
-bash-3.1# /home/s3sync/upload.sh
Create node Giles
</pre>
<p>&#8230;</p>
<p>I left it for an hour or so, after which it had uploaded 141.25Mb, logging all the while.  Clearly there was (a) something wrong with the way I had set up logging from the crontab, and (b) something had interrupted it when it had run the previous night.  After a little thought, I came to the conclusion that it might not ba a great idea to have something in the crontab that could take multiple hours to run; there could well be a limit, at least in the version of the cron daemon that lives on the NSLU2, and the sync process might have been killed before it was able to sync its output to the log file.  That said, I could find no mention of such a thing on the <a href="http://www.nslu2-linux.org/wiki/HowTo/DebugCrontabProblems">obvious page on the NSLU2-Linux site</a>.    I decided to ask the site&#8217;s mailing list, to see if anyone knew for sure if this was the answer; in the meantime, I watched the sync from the command line as it reached 683 items and 270Mb.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gilesthomas.com/?feed=rss2&amp;p=18</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project: Automated offsite backups for an NSLU2 &#8211; part 11</title>
		<link>http://www.gilesthomas.com/?p=16</link>
		<comments>http://www.gilesthomas.com/?p=16#comments</comments>
		<pubDate>Tue, 14 Nov 2006 23:00:09 +0000</pubDate>
		<dc:creator>giles</dc:creator>
				<category><![CDATA[NSLU2 offsite backup project]]></category>

		<guid isPermaLink="false">http://www.gilesthomas.com/?p=16</guid>
		<description><![CDATA[Previously in this series: Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10.
I&#8217;m setting up automated offsite backups from my NSLU2 to Amazon S3.  With suprisingly little effort, I&#8217;ve managed to get a tool called s3sync running on the &#8220;slug&#8221; (as it&#8217;s known). [...]]]></description>
			<content:encoded><![CDATA[<p>Previously in this series: <a href="http://www.gilesthomas.com/?p=5">Part 1</a>, <a href="http://www.gilesthomas.com/?p=6">Part 2</a>, <a href="http://www.gilesthomas.com/?p=7">Part 3</a>, <a href="http://www.gilesthomas.com/?p=8">Part 4</a>, <a href="http://www.gilesthomas.com/?p=9">Part 5</a>, <a href="http://www.gilesthomas.com/?p=10">Part 6</a>, <a href="http://www.gilesthomas.com/?p=11">Part 7</a>, <a href="http://www.gilesthomas.com/?p=12">Part 8</a>, <a href="http://www.gilesthomas.com/?p=14">Part 9</a>, <a href="http://www.gilesthomas.com/?p=15">Part 10</a>.</p>
<p>I&#8217;m setting up automated offsite backups from my <a href="http://www.linksys.com/servlet/Satellite?c=L_Product_C2&#038;childpagename=US%2FLayout&#038;cid=1115416906769&#038;pagename=Linksys%2FCommon%2FVisitorWrapper">NSLU2</a> to <a href="http://aws.amazon.com/s3">Amazon S3</a>.  With suprisingly little effort, I&#8217;ve managed to get a tool called <a href="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=11975&#038;start=0&#038;tstart=0">s3sync</a> running on the &#8220;slug&#8221; (as it&#8217;s known).  s3sync is a Ruby script, so in order to run it, I had to install <a href="http://www.ruby-lang.org/en/">Ruby</a>, which in turn meant that I had to <a href="http://www.gilesthomas.com/?p=11">replace</a> the slug&#8217;s firmware with a different version of Linux, called <a href="http://www.nslu2-linux.org/wiki/Unslung/HomePage">Unslung</a>.  All of this worked pretty much as advertised in the tools&#8217; respective documentation &#8211; for the details, see the previous posts in this series.</p>
<p>Having confirmed that s3sync worked as I&#8217;d expect it to, I needed to install it in a sensible place &#8211; I&#8217;d previously just put it in /tmp &#8211; set it up so that I could use SSL to encrypt the data while it was on its way to Amazon, and then write a script to synchronise at least one of the directories I want backed up.  I&#8217;d then be able to test the script, schedule it, test the scheduling, and then I&#8217;d be done!</p>
<p>First things first &#8211; I was getting annoyed with not having some of my favourite packages installed on the slug, so:</p>
<pre>
# ipkg install less
Installing less (394-2) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/unslung/cross/less_394-2_armeb.ipk
Installing ncursesw (5.5-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/unslung/cross/ncursesw_5.5-1_armeb.ipk
Installing ncurses (5.5-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/unslung/cross/ncurses_5.5-1_armeb.ipk
Configuring less
Configuring ncurses
Configuring ncursesw
# ipkg install bash
Installing bash (3.1-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/unslung/cross/bash_3.1-1_armeb.ipk
Installing readline (5.1-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/unslung/cross/readline_5.1-1_armeb.ipk
Configuring bash
Configuring readline
# ls /opt/bin/bash
# /opt/bin/bash
bash-3.1#
</pre>
<p>So, I edited <code>/etc/passwd</code> to make <code>/opt/bin/bash</code> the shell for root, logged out, then logged back in again.</p>
<p>OK, the next task was to installing s3sync somewhere sensible: I felt that <code>/home/s3sync</code> was a good enough place for the s3sync script itself and my own shell scripts, so I put everything there:</p>
<pre>
-bash-3.1# cd /home
-bash-3.1# mkdir s3sync
-bash-3.1# cd s3sync
-bash-3.1# mv /tmp/s3sync/* .
-bash-3.1# ls
HTTPStreaming.rb README.txt      README_s3cmd.txt S3.rb           S3_s3sync_mod.rb
S3encoder.rb     s3cmd.rb        s3sync.rb        s3try.rb        thread_generator.rb
-bash-3.1#
</pre>
<p>Next, it was necessary to install some root certificates so that it could use SSL to transfer data.  Working from <a href="http://blog.eberly.org/2006/10/09/how-automate-your-backup-to-amazon-s3-using-s3sync/">John Eberly&#8217;s post</a> on how he set up s3sync, I did the following:</p>
<pre>
-bash-3.1# mkdir certs
-bash-3.1# cd certs
-bash-3.1# wget http://mirbsd.mirsolutions.de/cvs.cgi/~checkout~/src/etc/ssl.certs.shar
Connecting to mirbsd.mirsolutions.de[85.214.23.162]:80
-bash-3.1# sh ssl.certs.shar
x - 00869212.0
x - 052e396b.0
x - 0bb21872.0
</pre>
<p>&#8230;</p>
<pre>
x - f4996e82.0
x - f73e89fd.0
x - ff783690.0
-bash-3.1#
</pre>
<p>And now I could put in scripts to upload to S3, based on John Eberly&#8217;s:</p>
<pre>
-bash-3.1# cat > upload.sh
#!/opt/bin/bash
# script to sync local directory up to s3
cd /home/s3sync
export AWS_ACCESS_KEY_ID=&lt;my key ID&gt;
export AWS_SECRET_ACCESS_KEY=&lt;my secret key&gt;
export SSL_CERT_DIR=/home/s3sync/certs
./s3sync.rb -r --ssl --delete "/user data/Giles/Catalogue" &lt;my key ID&gt;.Backups:/remotefolder
-bash-3.1# chmod 700 upload.sh
</pre>
<p>The chmod was required to stop non-root users (of whom I naturally have hordes on the slug :-) from being able to read the private key.  Better to be safe than sorry.  The directory I was syncing is a very small subdirectory of the area I want to back up to S3.</p>
<p>Next, a download script:</p>
<pre>
-bash-3.1# cat > download.sh
#!/opt/bin/bash
# script to sync "directory" down from s3
cd /home/s3sync
export AWS_ACCESS_KEY_ID=&lt;my key ID&gt;
export AWS_SECRET_ACCESS_KEY=&lt;my secret key&gt;
export SSL_CERT_DIR=/home/s3sync/certs
./s3sync.rb -r --ssl --delete &lt;my key ID&gt;:/remotefolder/Catalogue/ /downloads/
-bash-3.1# chmod 700 download.sh
-bash-3.1#
</pre>
<p>Next, I created the &lt;my key ID&gt;.Backups bucket using <a href="https://jets3t.dev.java.net/cockpit.html">jets3t Cockpit</a>, and then ran the upload script:</p>
<pre>
-bash-3.1# ./upload.sh
-bash-3.1#
</pre>
<p>A quick check confirmed that the data had been uploaded.  However, I found myself thinking &#8211; I&#8217;d like the tool to log a bit more than that.  s3sync&#8217;s usage said that there was a &#8220;-v&#8221; option to run it in verbose mode, so I set that in the upload script and reran it.  There was still no output, but I suspected that that was simply because there were no changes to upload&#8230; so I deleted the data from S3 using jets3t Cockpit, and reran.   This time I got output:</p>
<pre>
-bash-3.1# ./upload.sh
Create node 19_Ejiri.jpg
Create node 22_Okabe.jpg
Create node 29_The_Original_Hachiman_Shrine_at_Suna_Village.jpg
Create node 47_Kameyama.jpg
-bash-3.1#
</pre>
<p>Time to test the download script (adding the -v to it first):</p>
<pre>
-bash-3.1# mkdir /downloads/
-bash-3.1# ./download.sh
Create node 19_Ejiri.jpg
Create node 22_Okabe.jpg
Create node 29_The_Original_Hachiman_Shrine_at_Suna_Village.jpg
Create node 47_Kameyama.jpg
-bash-3.1# ls -lrt /downloads/
-rwxrw----    1 guest    everyone   578008 Nov 14 22:30 19_Ejiri.jpg
-rwxrw----    1 guest    everyone   607822 Nov 14 22:30 22_Okabe.jpg
-rwxrw----    1 guest    everyone   563472 Nov 14 22:30 29_The_Original_Hachiman_Shrine_at_Suna_Village.jpg
-rwxrw----    1 guest    everyone   681194 Nov 14 22:31 47_Kameyama.jpg
-bash-3.1# ls -lrt /user\ data/Giles/Catalogue/
-rwxrw----    1 guest    everyone   607822 Mar 17  2005 22_Okabe.jpg
-rwxrw----    1 guest    everyone   578008 Mar 17  2005 19_Ejiri.jpg
-rwxrw----    1 guest    everyone   681194 Mar 17  2005 47_Kameyama.jpg
-rwxrw----    1 guest    everyone   563472 Mar 17  2005 29_The_Original_Hachiman_Shrine_at_Suna_Village.jpg
</pre>
<p>Hooray!  So, finally, I decided to try syncing up my entire &#8220;user data&#8221; share on an <code>cron</code> job, set to execute very soon.  I modified the <code>upload.sh</code> script to point to the correct directory, and then edited <code>/etc/crontab</code>, adding a line saying:</p>
<pre>
42 22 * * * root /home/s3sync/upload.sh &#038;> /tmp/s3sync.log
</pre>
<p>And then I waited until 10:42pm by the slug&#8217;s time (which, incidentally, seemed to have drifted a minute or so since the previous evening).  At 10:42pm, I checked what processes were running:</p>
<pre>
-bash-3.1# ps auxww
  PID TTY     Uid        Size State Command
    1         root       1212   S   /bin/init
    2         root          0   S   [keventd]
</pre>
<p>&#8230;</p>
<pre>
 1628 ttyp1   root       2100   S   -bash
 1715         root       2036   S   /opt/bin/bash /home/s3sync/upload.sh
 1716         root      12856   S   /opt/bin/ruby ./s3sync.rb -v -r --ssl --del
 1718 ttyp1   root       1984   R   ps auxww
-bash-3.1#
</pre>
<p>Excellent.  The logfile was there; nothing had been written yet, but checking the bucket showed that data was already being copied up.  My best guess was that the logfile would be flushed at a later point.</p>
<p>At this point, all I could really do was wait &#8211; so it was time to leave the slug for the day, ready to check the next.  If everything had synchronised up correctly &#8211; and a download to another machine worked &#8211; then I would be able to say that I&#8217;d completed the project :-)</p>
<p>Next: <a href="http://www.gilesthomas.com/?p=18">Scheduling part 2</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gilesthomas.com/?feed=rss2&amp;p=16</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project: Automated offsite backups for an NSLU2 &#8211; part 10</title>
		<link>http://www.gilesthomas.com/?p=15</link>
		<comments>http://www.gilesthomas.com/?p=15#comments</comments>
		<pubDate>Tue, 14 Nov 2006 01:15:21 +0000</pubDate>
		<dc:creator>giles</dc:creator>
				<category><![CDATA[NSLU2 offsite backup project]]></category>

		<guid isPermaLink="false">http://www.gilesthomas.com/?p=15</guid>
		<description><![CDATA[Previously in this series: Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9.
I&#8217;m setting up automated offsite backups from my NSLU2 to Amazon S3.  With suprisingly little effort, I&#8217;ve managed to get a tool called s3sync running on the &#8220;slug&#8221; (as it&#8217;s known).  s3sync [...]]]></description>
			<content:encoded><![CDATA[<p>Previously in this series: <a href="http://www.gilesthomas.com/?p=5">Part 1</a>, <a href="http://www.gilesthomas.com/?p=6">Part 2</a>, <a href="http://www.gilesthomas.com/?p=7">Part 3</a>, <a href="http://www.gilesthomas.com/?p=8">Part 4</a>, <a href="http://www.gilesthomas.com/?p=9">Part 5</a>, <a href="http://www.gilesthomas.com/?p=10">Part 6</a>, <a href="http://www.gilesthomas.com/?p=11">Part 7</a>, <a href="http://www.gilesthomas.com/?p=12">Part 8</a>, <a href="http://www.gilesthomas.com/?p=14">Part 9</a>.</p>
<p>I&#8217;m setting up automated offsite backups from my <a href="http://www.linksys.com/servlet/Satellite?c=L_Product_C2&#038;childpagename=US%2FLayout&#038;cid=1115416906769&#038;pagename=Linksys%2FCommon%2FVisitorWrapper">NSLU2</a> to <a href="http://aws.amazon.com/s3">Amazon S3</a>.  With suprisingly little effort, I&#8217;ve managed to get a tool called <a href="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=11975&#038;start=0&#038;tstart=0">s3sync</a> running on the &#8220;slug&#8221; (as it&#8217;s known).  s3sync is a Ruby script, so in order to run it, I had to install <a href="http://www.ruby-lang.org/en/">Ruby</a>, which in turn meant that I had to <a href="http://www.gilesthomas.com/?p=11">replace</a> the slug&#8217;s firmware with a different version of Linux, called <a href="http://www.nslu2-linux.org/wiki/Unslung/HomePage">Unslung</a>.  All of this worked pretty much as advertised in the tools&#8217; respective documentation &#8211; for the details, see the previous posts in this series.</p>
<p>As all of the pieces were in place, I next needed to do some simple tests to make sure it could handle the kind of files I wanted it to back up.  In particular, I wanted it to be able to handle deep directory hierarchies, and to remember user and group ownership and file permissions.</p>
<p>The first step was to create some test files.</p>
<pre>
# cd /tmp
# mkdir testdata
# cd testdata
# mkdir directorynumber1
# cd directorynumber1
# mkdir directorynumber2
# cd directorynumber2
</pre>
<p>&#8230;</p>
<pre>
# cd directorynumber21
# pwd
/tmp/testdata/directorynumber1/directorynumber2/directorynumber3/directorynumber4/directorynumber5/directorynumber6/directorynumber7/directorynumber8/directorynumber9/directorynumber10/directorynumber11/directorynumber12/directorynumber13/directorynumber14/directorynumber15/directorynumber16/directorynumber17/directorynumber18/directorynumber19/directorynumber20/directorynumber21
# cat > file000
000
# chmod 000 file000
# cat > file644
644
# chmod 644 file644
# cat > file777
777
# chmod 777 file777
# chown guest:nobody file777
# chown bin:administrators file000
# ls -lrt
----------    1 bin      administ        4 Nov 14  2006 file000
-rw-r--r--    1 root     root            4 Nov 14  2006 file644
-rwxrwxrwx    1 guest    nobody          4 Nov 14  2006 file777
#
</pre>
<p>So, I had some files with differing permissions and ownership, at the bottom of a directory hierarchy with over 350 characters in it &#8211; I had a vague impression that there might be a 200-character key limit on S3, and I&#8217;m always worried about 255-character limits, so 350 seemed like a sensible test length; if a system can manage 350, it can probably manage much larger figures, up to 32,767 or so&#8230;  Anyway, the next step was to sync the whole thing up to S3:</p>
<pre>
# cd /tmp/s3sync/
# ./s3sync.rb -r /tmp/testdata &lt;my key ID&gt;.Test:yetanotherprefix
#
</pre>
<p>A quick check with <a href="https://jets3t.dev.java.net/cockpit.html">jets3t Cockpit</a> confirmed that everything was uploaded with appropriate-looking keys, and also with properties specifying decent-looking integer owner, group and permission values.  This looked good &#8211; no key-length limit issues.  However, there was only one way to be absolutely sure that it was working:</p>
<pre>
# ./s3sync.rb -r &#038;ltmy key ID&gt;.Test:yetanotherprefix/testdata/ /tmp/copytestdata
#
</pre>
<p>(Note the positions of the slashes, etc. &#8211; the full syntax for s3sync can take a while to work out, but the <a href="http://s3.amazonaws.com/ServEdge_pub/s3sync/README.txt">README</a> documents it well if you take the time to read it&#8230;)</p>
<p>And then, to confirm that it&#8217;s OK:</p>
<pre>
# cd /tmp/copytestdata/directorynumber1/directorynumber2/directorynumber3/directorynumber4/directorynumber5/directorynumber6/directorynumber7/directorynumber8/directorynumber9/directorynumber10/directorynumber11/directorynumber12/directorynumber13/directorynumber14/directorynumber15/directorynumber16/directorynumber17/directorynumber18/directorynumber19/directorynumber20/directorynumber21/
# ls -lrt
-rw-r--r--    1 root     root            4 Nov 14 01:03 file644
----------    1 bin      administ        4 Nov 14 01:03 file000
-rwxrwxrwx    1 guest    nobody          4 Nov 14 01:03 file777
#
</pre>
<p>&#8230;which all looked correct!</p>
<p>So now I knew that s3sync would work from the NSLU2 to Amazon S3, that the file attributes I cared about were being persisted, and that deep directory hierarchies were not a problem.  The next step would have to be to get it working with full SSL, as I don&#8217;t really want my private data flying over the public Internet unencrypted, and then to put the whole thing into a shell script and schedule a cron job to sync daily.</p>
<p>Next: <a href="http://www.gilesthomas.com/?p=16">SSL, and scheduling part 1</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gilesthomas.com/?feed=rss2&amp;p=15</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project: Automated offsite backups for an NSLU2 &#8211; part 9</title>
		<link>http://www.gilesthomas.com/?p=14</link>
		<comments>http://www.gilesthomas.com/?p=14#comments</comments>
		<pubDate>Tue, 14 Nov 2006 00:07:07 +0000</pubDate>
		<dc:creator>giles</dc:creator>
				<category><![CDATA[NSLU2 offsite backup project]]></category>

		<guid isPermaLink="false">http://www.gilesthomas.com/?p=14</guid>
		<description><![CDATA[Previously in this series: Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8.
I&#8217;m setting up automated offsite backups from my NSLU2 to Amazon S3.  The tool I need to use to make this happen is called s3sync; it&#8217;s a Ruby script, so in order to run it, [...]]]></description>
			<content:encoded><![CDATA[<p>Previously in this series: <a href="http://www.gilesthomas.com/?p=5">Part 1</a>, <a href="http://www.gilesthomas.com/?p=6">Part 2</a>, <a href="http://www.gilesthomas.com/?p=7">Part 3</a>, <a href="http://www.gilesthomas.com/?p=8">Part 4</a>, <a href="http://www.gilesthomas.com/?p=9">Part 5</a>, <a href="http://www.gilesthomas.com/?p=10">Part 6</a>, <a href="http://www.gilesthomas.com/?p=11">Part 7</a>, <a href="http://www.gilesthomas.com/?p=12">Part 8</a>.</p>
<p>I&#8217;m setting up automated offsite backups from my <a href="http://www.linksys.com/servlet/Satellite?c=L_Product_C2&#038;childpagename=US%2FLayout&#038;cid=1115416906769&#038;pagename=Linksys%2FCommon%2FVisitorWrapper">NSLU2</a> to <a href="http://aws.amazon.com/s3">Amazon S3</a>.  The tool I need to use to make this happen is called <a href="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=11975&#038;start=0&#038;tstart=0">s3sync</a>; it&#8217;s a Ruby script, so in order to run it, I had to work out some way of installing <a href="http://www.ruby-lang.org/en/">Ruby</a>.  In order to do <i>that</i>, I had to <a href="http://www.gilesthomas.com/?p=11">replace</a> the slug&#8217;s firmware with a different version of Linux, called <a href="http://www.nslu2-linux.org/wiki/Unslung/HomePage">Unslung</a>; once that was done, <a href="http://www.gilesthomas.com/?p=12">getting Ruby up and running</a> wasn&#8217;t too tricky.  The next step was to get s2sync itself to work.</p>
<p>I started by getting the s3sync script itself copied over to the slug.  It&#8217;s a gzipped tar archive, and is available from a web server &#8211; so the obvious tools to use were gunzip, tar, and wget.  Conveniently, these were already installed as part of Unslung (or perhaps the original firmware):</p>
<pre>
# gunzip
gunzip: compressed data not read from terminal.  Use -f to force it.
# wget
BusyBox v1.00 (2006.04.11-01:22+0000) multi-call binary

Usage: wget [-c|--continue] [-q|--quiet] [-O|--output-document file]
                [--header 'header: value'] [-Y|--proxy on/off] [-P DIR] url

wget retrieves files via HTTP or FTP

Options:
</pre>
<p>&#8230;</p>
<pre>
# tar
BusyBox v1.00 (2006.04.11-01:22+0000) multi-call binary

Usage: tar -[czjZxtvO] [-f TARFILE] [-C DIR] [FILE(s)] ...

Create, extract, or list files from a tar file.

Options:
</pre>
<p>&#8230;</p>
<pre>
#
</pre>
<p>So, I created a temporary directory, downloaded, and unpacked the script:</p>
<pre>
# cd /tmp
# mkdir s3sync
# cd s3sync
# wget http://s3.amazonaws.com/ServEdge_pub/s3sync/s3sync.tar.gz
Connecting to s3.amazonaws.com[72.21.206.42]:80
# gunzip s3sync.tar.gz
# tar xf s3sync.tar
# ls
HTTPStreaming.rb README.txt      README_s3cmd.txt S3.rb
S3_s3sync_mod.rb S3encoder.rb    s3cmd.rb         s3sync.rb
s3sync.tar       s3try.rb         thread_generator.rb
#
</pre>
<p>The Ruby files, I noted, were not marked as executable, so I fixed that.  I also remembered from when I was <a href="http://www.gilesthomas.com/?p=12">installing Ruby</a> on the slug that the location of the interpreter installed by the standard Unslung package was not on the path &#8211; it was <tt>/opt/bin/ruby</tt>, and so the &#8220;#!&#8221; lines at the start of the scripts would probably need to be changed to reflect that.  I checked the start of the s3sync scripts, and noticed that all of the top-level ones used the following first line:</p>
<pre>
#!/usr/bin/env ruby
</pre>
<p>This looked a bit odd to me &#8211; I&#8217;ve used <code>env</code> to list the environment, but never as a launcher for an interpreter.  However, a quick <a href="http://srfi.schemers.org/srfi-22/mail-archive/msg00070.html">poke around</a> made me comfortable that it was just a way of avoiding putting an explicit path to the interpreter into the script file.  As <code>/usr/bin/env</code> did not exist on the slug yet &#8211; though perhaps I could have installed it &#8211; I decided to modify the scripts to refer to the location of the <code>ruby</code> command on the machine.</p>
<p>The next steps were to set up the access key ID and the secret key, just as before:</p>
<pre>
# export AWS_ACCESS_KEY_ID=&lt;my key ID&gt;
# export AWS_SECRET_ACCESS_KEY=&lt;my key&gt;
</pre>
<p>&#8230;and to try running the script as a test, once more to synchronising the script&#8217;s own directory into the bucket I&#8217;d previously set up on S3 (with a different prefix for the keys to the one I used in my original test).</p>
<pre>
# ./s3sync.rb -r . &lt;my key ID&gt;.Test:adifferentprefix
./S3encoder.rb:42:in `iconv': invalid encoding ("UTF-8", "ISO-8859-1") (Iconv::InvalidEncoding)
        from ./S3encoder.rb:42:in `escape'
        from ./S3.rb:138:in `list_bucket'
        from ./s3sync.rb:21:in `map'
        from ./S3.rb:138:in `each'
        from ./S3.rb:138:in `map'
        from ./S3.rb:138:in `list_bucket'
        from ./s3try.rb:51:in `send'
        from ./s3try.rb:51:in `S3try'
        from ./s3sync.rb:244:in `s3TreeRecurse'
        from ./s3sync.rb:293:in `main'
        from ./thread_generator.rb:79:in `call'
        from ./thread_generator.rb:79:in `initialize'
        from ./thread_generator.rb:76:in `new'
        from ./thread_generator.rb:76:in `initialize'
        from ./s3sync.rb:226:in `new'
        from ./s3sync.rb:226:in `main'
        from ./s3sync.rb:631
#
</pre>
<p>Oh dear.  Well, I&#8217;d wanted to learn Ruby for some time, so here was a great incentive.  The line causing the error, line 42 in S3encoder.rb, read:</p>
<pre>
result = Iconv.iconv("UTF-8", @nativeCharacterEncoding, string).join if @useUTF8InEscape
</pre>
<p>A bit of Googling around led to a (the?) Ruby documentation site, where from the <a href="http://ruby-doc.org/core/classes/Iconv.html">page describing the Iconv class</a>, it was clear that this call was a way of asking the runtime environment to convert the string in the variable <code>string</code> from the UTF-8 character set to whatever charset was specified in the variable (or perhaps field?) <code>nativeCharacterEncoding</code>.  A few lines higher up,  <code>nativeCharacterEncoding</code> appeared to be being set to &#8220;ISO-8859-1&#8243;, which made sense, especially given the error message.</p>
<p>However, this seemed strange &#8211; after all, UTF-8 is pretty much the standard character set for most new applications and systems, and ISO-8859-1, aka Latin-1, is the charset that predated it (and is used for most HTML).   Still, the slug is a small embedded system &#8211; so perhaps, I thought, it might lack certain charsets?  Might it be something dreadful like ASCII-only?</p>
<p>I decided to read through the list of available packages, to see if there was something obvious that needed to be installed &#8211; an &#8220;essential-charsets&#8221; package or something like that:</p>
<pre>
# ipkg list
abook - 0.5.5-1 - Abook is a text-based addressbook program designed to use with mutt mail client.
adduser - 1.1.3-6 - a multi-call binary for login and user account administration
adns - 1.3-2 - Asynchronous resolver library and DNS resolver utilities.
</pre>
<p>&#8230;</p>
<pre>
gambit-c - 4.0b20-1 - A portable implementation of Scheme.
gawk - 3.1.5-1 - Gnu AWK interpreter
gconv-modules - 2.2.5-5 - Provides gconv modules missing from the firmware.  These are used by glibc's iconv() implementation.
</pre>
<p>Now that last one looked promising &#8211; after all, as the Ruby documentation said:</p>
<blockquote><p>
Iconv is a wrapper class for the UNIX 95 iconv() function family, which translates string between various encoding systems.
</p></blockquote>
<p>I gave it a go:</p>
<pre>
# ipkg install gconv-modules
Installing gconv-modules (2.2.5-5) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/unslung/cross/gconv-modules_2.2.5-5_armeb.ipk
Configuring gconv-modules
#
</pre>
<p>&#8230;and tried running the command again:</p>
<pre>
# ./s3sync.rb -r . &lt;my key ID&gt;.Test:adifferentprefix
S3 command failed:
list_bucket &lt;my key ID&gt;.TEST max-keys 200 prefix adifferentprefix/. delimiter /
With result 403 Forbidden
S3 ERROR: #<Net::HTTPForbidden:0x4065bf04>
./s3sync.rb:249:in `+': can't convert nil into Array (TypeError)
        from ./s3sync.rb:249:in `s3TreeRecurse'
        from ./s3sync.rb:293:in `main'
        from ./thread_generator.rb:79:in `call'
        from ./thread_generator.rb:79:in `initialize'
        from ./thread_generator.rb:76:in `new'
        from ./thread_generator.rb:76:in `initialize'
        from ./s3sync.rb:226:in `new'
        from ./s3sync.rb:226:in `main'
        from ./s3sync.rb:631
#
</pre>
<p>This was fantastic news!  Although it had not synced, it had clearly contacted S3, and had been refused access &#8211; so the charset problem was, it appeared, solved.</p>
<p>Now, back when I tried to get s3sync to work on my Ubuntu box, I&#8217;d discovered that it would refuse to sync when the machine&#8217;s local time was skewed from the S3 server&#8217;s time.  I&#8217;d foolishly forgotten to check the slug&#8217;s time before trying this sync, so before trying anything else I decided to check that it was OK:</p>
<pre>
# date
Tue Nov 14 02:49:31 GMT 2006
</pre>
<p>D&#8217;oh.  It was 11:43pm on Monday 13 November when I typed that.  So, I fixed it and tried again:</p>
<pre>
# date 11132344
Mon Nov 13 23:44:00 GMT 2006
# ./s3sync.rb -r . &lt;my key ID&gt;.Test:adifferentprefix
#
</pre>
<p>Which looked pretty good.  I checked the S3 server, using the <a href="https://jets3t.dev.java.net/cockpit.html">jets3t Cockpit</a> tool that I&#8217;d used <a href="http://www.gilesthomas.com/?p=10">before</a>, and lo and behold &#8211; the files were there!</p>
<p>So, I now had successfully used s3sync to synchronise a directory from my NSLU2 up to Amazon S3 &#8211; which was the main point of this project.  While there was still a little bit of work to do &#8211; for example, making sure it worked with reasonably deep directory hierarchies, checking user/group ownership and permissions were persisted, setting up encryption, and setting up a cron job to automate the backup &#8211; the most tricky and experimental part of the work was done.</p>
<p>Next: <a href="http://www.gilesthomas.com/?p=15">File attributes, and deep directory hierarchies</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gilesthomas.com/?feed=rss2&amp;p=14</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Project: Automated offsite backups for an NSLU2 &#8211; part 8</title>
		<link>http://www.gilesthomas.com/?p=12</link>
		<comments>http://www.gilesthomas.com/?p=12#comments</comments>
		<pubDate>Sun, 12 Nov 2006 04:00:21 +0000</pubDate>
		<dc:creator>giles</dc:creator>
				<category><![CDATA[NSLU2 offsite backup project]]></category>

		<guid isPermaLink="false">http://www.gilesthomas.com/?p=12</guid>
		<description><![CDATA[Previously in this series: Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7.
I&#8217;ve discovered that in order to get automated offsite backups from my NSLU2 to Amazon S3, I have to get it to run Ruby so that it can run s3sync.  Installing Ruby required the slug&#8217;s firmware to [...]]]></description>
			<content:encoded><![CDATA[<p>Previously in this series: <a href="http://www.gilesthomas.com/?p=5">Part 1</a>, <a href="http://www.gilesthomas.com/?p=6">Part 2</a>, <a href="http://www.gilesthomas.com/?p=7">Part 3</a>, <a href="http://www.gilesthomas.com/?p=8">Part 4</a>, <a href="http://www.gilesthomas.com/?p=9">Part 5</a>, <a href="http://www.gilesthomas.com/?p=10">Part 6</a>, <a href="http://www.gilesthomas.com/?p=11">Part 7</a>.</p>
<p>I&#8217;ve discovered that in order to get automated offsite backups from my <a href="http://www.linksys.com/servlet/Satellite?c=L_Product_C2&#038;childpagename=US%2FLayout&#038;cid=1115416906769&#038;pagename=Linksys%2FCommon%2FVisitorWrapper">NSLU2</a> to <a href="http://aws.amazon.com/s3">Amazon S3</a>, I have to get it to run <a href="http://www.ruby-lang.org/en/">Ruby</a> so that it can run <a href="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=11975&#038;start=0&#038;tstart=0">s3sync</a>.  Installing Ruby required the slug&#8217;s firmware to be upgraded to a new version of Linux, called <a href="http://www.nslu2-linux.org/wiki/Unslung/HomePage">Unslung</a>, so <a href="http://www.gilesthomas.com/?p=11">I did that</a> &#8211; and I also <a href="http://www.gilesthomas.com/?p=10">installed</a> s3sync on a <a href="http://www.ubuntu.com/">Ubuntu</a> machine as a dry run.  Both of these worked out OK, so the next step was to get the Ruby language itself running under the Unslung firmware &#8211; and importantly, to make sure that Ruby had the OpenSSL package installed; the latter had proven non-obvious under regular Linux, so I was expecting problems on Unslung, which is, after all, a cut-down version of the operating system.</p>
<p>The first thing was to work out how to install new packages on an Unslung system in the first place.  The last section of the installation README gives a link to <a href="http://www.nslu2-linux.org/wiki/Unslung/Packages">this page</a>, which is a good starting point.  Going from the instructions there, I made sure that the gateway and DNS server were correctly set up on the slug&#8217;s web admin pages, then ran <code>ipkg update</code> from a telnet window logged into the unslung slug.  This seemed to work just fine &#8211; appropriate messages about downloading, inflating and updating things went by.  The next recommended steps were to run <code>ipkg install unslung-feeds</code>, and then <code>ipkg update</code> again.   I&#8217;m sure there is a very good reason for this, but I&#8217;ve no idea what it is &#8211; for now, I just followed the instructions, bleating occasionally.  Nothing obviously bad happened, and it looked like it managed to install some further lists of software.</p>
<p>The next step was to run <code>ipkg list</code> to see what I could now install.  And wow, there were a lot of packages.  Most importantly for this project, there was the <code>ruby</code> one, so&#8230;</p>
<pre>
# ipkg install ruby
Installing ruby (1.8.5-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/unslung/cross/ruby_1.8.5-1_armeb.ipk
Configuring ruby
#
</pre>
<p>That looked promising &#8211; but&#8230;</p>
<pre>
# ruby --version
ruby: No such file or directory
</pre>
<p>Hmmm.  So, how to find out where it&#8217;s been installed?   Well, <code>ipkg --help</code> is apparently an unrecognised option, but when I tried it, it forced a printout of the options for ipkg anyway.  This made it clear that I should run <code>ipkg files ruby</code> to find out where everything was, and from there I found out that it had installed the binary in <code>/opt/bin/</code> &#8211; which is not unreasonable.  </p>
<pre>
# /opt/bin/ruby --version
ruby 1.8.5 (2006-08-25) [armv5b-linux]
</pre>
<p>Looking good!  Come to thing of it, that&#8217;s a more recent version of Ruby than the default for Ubuntu Linux :-)</p>
<p>Now, as I said earlier in this post, one worry I had was the difficulty of installing the Ruby OpenSSL libraries, which are a requirement for s3sync.  I had noticed something relevant-looking as the list of files for the package went past earlier, so decided to double-check:</p>
<pre>
# ls /opt/lib/ruby/1.8/openssl/
bn.rb           buffering.rb    cipher.rb       digest.rb       ssl.rb
x509.rb
</pre>
<p>This was pretty promising &#8211; not a sure thing, but it looked good.  So how to be sure &#8211; or, at least reasonably sure &#8211; that nothing was missing?  Well, going back to the error message I got <a href="http://www.gilesthomas.com/?p=10">when s3sync failed on my Ubuntu machine</a> (which, at the time, lacked an OpenSSL library for Ruby) I noted that I&#8217;d had the error </p>
<pre>
./S3.rb:25:in `require': no such file to load -- openssl (LoadError)
</pre>
<p>So, it sounded to me like the &#8220;require&#8221; command in Ruby loads libraries &#8211; perhaps somewhat like <code>import</code> in Python or Java, or <code>using</code> in C#.  A quick grep through the s3sync source seemed to confirm this &#8211; the first few non-comment lines of S3.rb ran:</p>
<pre>
require 'base64'
require 'cgi'
</pre>
<p>&#8230;and then, shortly after, there was:</p>
<pre>
require 'openssl'
</pre>
<p>So, I could reasonably comfortably posit that if a Ruby script containing just that last line would run happily on the slug, s3sync should be able to run.  On that basis, I created such a file and ran it:</p>
<pre>
# cd /tmp
# ls
# cat > test.rb
require 'openssl'
# /opt/bin/ruby test.rb
/opt/lib/ruby/1.8/armv5b-linux/openssl.so: libssl.so.0.9.7: cannot open shared object file: No such file or directory - /opt/lib/ruby/1.8/armv5b-linux/openssl.so (LoadError)
        from /opt/lib/ruby/1.8/openssl.rb:17
        from test.rb:1:in `require'
        from test.rb:1
#
</pre>
<p>Now, from this I suspected that the Ruby system had its own SSL stuff installed, and it was just the operating system&#8217;s shared library that was missing.  In retrospect, this was not obvious &#8211; after all, the file that was missing was in <tt>/opt/lib/ruby</tt>.  But, without noticing that, I decided to try installing any non-Ruby OpenSSL package that was out there:</p>
<pre>
# ipkg list | grep ssl
alac-decoder - 0.1.0-2 - A decoder for the apple lossless file format
flac - 1.1.2-4 - FLAC is a free lossless audio codec.  This package contains the codec libraries and the command-line tools flac and metaflac.
openssl - 0.9.7d-5 - Openssl provides the ssl implementation in libraries libcrypto and libssl, and is needed by many other applications and librari
perl-io-socket-ssl - 0.999-1 - IO-Socket-SSL - Nearly transparent SSL encapsulation for IO::Socket::INET
perl-net-ssleay - 1.30-1 - Net_SSLeay - Perl extension for using OpenSSL
wget-ssl - 1.10.2-3 - A network utility to retrieve files from the Web
# ipkg install openssl
Installing openssl (0.9.7d-5) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/unslung/cross/openssl_0.9.7d-5_armeb.ipk
Configuring openssl
#
</pre>
<p>&#8230;and then tried running the script again:</p>
<pre>
# /opt/bin/ruby test.rb
#
</pre>
<p>Which looked perfect.  Perhaps someone can tell me how that all worked&#8230; or perhaps I&#8217;ll work it out myself later.  But for now, onward!  The next step was clearly to copy over s3sync, and to try it out on a simple directory.  And that&#8217;s one for tomorrow.</p>
<p>Next: <a href="http://www.gilesthomas.com/?p=14">Running s3sync on an Unslung NSLU2</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gilesthomas.com/?feed=rss2&amp;p=12</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project: Automated offsite backups for an NSLU2 &#8211; part 7</title>
		<link>http://www.gilesthomas.com/?p=11</link>
		<comments>http://www.gilesthomas.com/?p=11#comments</comments>
		<pubDate>Sun, 12 Nov 2006 02:01:59 +0000</pubDate>
		<dc:creator>giles</dc:creator>
				<category><![CDATA[NSLU2 offsite backup project]]></category>

		<guid isPermaLink="false">http://www.gilesthomas.com/?p=11</guid>
		<description><![CDATA[Previously in this series: Part 1, Part 2, Part 3, Part 4, Part 5, Part 6.
I&#8217;ve discovered that in order to get automated offsite backups from my NSLU2 to Amazon S3, I have to get it to run Ruby so that it can run s3sync.  I&#8217;ve installed the latter on a Ubuntu machine as [...]]]></description>
			<content:encoded><![CDATA[<p>Previously in this series: <a href="http://www.gilesthomas.com/?p=5">Part 1</a>, <a href="http://www.gilesthomas.com/?p=6">Part 2</a>, <a href="http://www.gilesthomas.com/?p=7">Part 3</a>, <a href="http://www.gilesthomas.com/?p=8">Part 4</a>, <a href="http://www.gilesthomas.com/?p=9">Part 5</a>, <a href="http://www.gilesthomas.com/?p=10">Part 6</a>.</p>
<p>I&#8217;ve discovered that in order to get automated offsite backups from my <a href="http://www.linksys.com/servlet/Satellite?c=L_Product_C2&#038;childpagename=US%2FLayout&#038;cid=1115416906769&#038;pagename=Linksys%2FCommon%2FVisitorWrapper">NSLU2</a> to <a href="http://aws.amazon.com/s3">Amazon S3</a>, I have to get it to run <a href="http://www.ruby-lang.org/en/">Ruby</a> so that it can run <a href="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=11975&#038;start=0&#038;tstart=0">s3sync</a>.  I&#8217;ve <a href="http://www.gilesthomas.com/?p=10">installed</a> the latter on a <a href="http://www.ubuntu.com/">Ubuntu</a> machine as a dry run, and it all looks good &#8211; so now I need to get Ruby onto the slug, and the first step in that direction is to install <a href="http://www.nslu2-linux.org/wiki/Unslung/HomePage">Unslung</a>.</p>
<p>I won&#8217;t detail what you have to do to install Unslung, as that&#8217;s likely to change, and the last thing I want is for someone to land here in a few months time, follow my out-of-date instructions, and destroy their hardware.  So, suffice it to say &#8211; I followed the instructions at the <a href="http://www.nslu2-linux.org/wiki/Unslung/NewUsersGuide">Unslung New User&#8217;s Guide</a> and in the README file that came with the download &#8211; and I followed them <i>exactly</i>.  I&#8217;ve supported enough software to know that most  problems encountered by experienced users come from overconfidence and not following instructions&#8230; so I don&#8217;t want to be one of the people I&#8217;ve cursed in the past.</p>
<p>All that said, I did encounter one problem that required a quick detour; once I had done the initial checks, and tried to upload the Unslung firmware from the NSLU2&#8217;s web admin pages, I got an error dialog saying &#8220;upgrade: no enough free space&#8221; (sic).  A quick poke around with Google made it clear that some people had fixed similar-sounding problems using a tool called &#8220;EraseAll&#8221; to clear out the slug&#8217;s flash RAM prior to doing an upgrade &#8211; but a quick check at the NSLU2-Linux site made it clear that they thought that using this tool was <a href="http://www.nslu2-linux.org/wiki/HowTo/EraseAll">a terrible idea</a>!  Further investigation showed that there was a <a href="http://www.nslu2-linux.org/wiki/FAQ/WebUpgradeErrors">FAQ</a> on the NSLU2-Linux site regarding similar (but different) messages, saying that out of memory errors when flashing </p>
<blockquote><p>
may be due to a SLUG using an older Linksys FW. My 2nd SLUG had the .24 version and faced this issue even after a factory reset and going straight to the download page. Linksys has a <a href="http://linksys.custhelp.com/cgi-bin/linksys.cfg/php/enduser/std_adp.php?p_faqid=2901&#038;p_created=1124756239&#038;p_sid=aQ1YvHki&#038;p_accessibility=0&#038;p_lva=&#038;p_sp=cF9zcmNoPTEmcF9zb3J0X2J5PSZwX2dyaWRzb3J0PSZwX3Jvd19jbnQ9NiZwX3Byb2RzPTc0NiZwX2NhdHM9JnBfcHY9MS43NDYmcF9jdj0mcF9zZWFyY2hfdHlwZT1hbnN3ZXJzLnNlYXJjaF9ubCZwX3NjZl9sYW5nPTEmcF9wYWdlPTE*&#038;p_li=&#038;p_topview=1">help page</a> that will walk you through upgrading to the .63 FW. Once I did this, upgrading to the Unslung FW was per the install guide.
</p></blockquote>
<p>My slug is <i>very</i> old &#8211; its firmware was also the antediluvian V2.3R24 &#8211; so I kind of suspected that was the problem&#8230; I decided to upgrade to the latest Linksys firmware, and went to <a href="http://linksys.custhelp.com/cgi-bin/linksys.cfg/php/enduser/std_adp.php?p_faqid=2901&#038;p_created=1124756239&#038;p_sid=aQ1YvHki&#038;p_accessibility=0&#038;p_lva=&#038;p_sp=cF9zcmNoPTEmcF9zb3J0X2J5PSZwX2dyaWRzb3J0PSZwX3Jvd19jbnQ9NiZwX3Byb2RzPTc0NiZwX2NhdHM9JnBfcHY9MS43NDYmcF9jdj0mcF9zZWFyY2hfdHlwZT1hbnN3ZXJzLnNlYXJjaF9ubCZwX3NjZl9sYW5nPTEmcF9wYWdlPTE*&#038;p_li=&#038;p_topview=1">the page linked</a> from the FAQ.  Worryingly, that page said that you should use EraseAll, which I was feeling quite nervous of &#8211; so before trying to follow its instructions, I decided to see what would happen if I used the regular web-based interface on the NSLU2 to upgrade to the new V2.3R63 firmware (which is linked at the bottom of the page).  To my delight, that seemed to work &#8211; at least the admin pages said that it was now version 2.3R63 &#8211; so I powered the unit down, plugged my drive back in, powered up again, and checked that the disk was still accessible.  It was, so I started the Unslung install procedure from the README once more, from the top.  This time, it seemed to work &#8211; the process completed without errors, the unit rebooted, and when (after a nail-biting few minutes) it came up, I checked the web interface, and it reported that its firmware version was V2.3R63-uNSLUng-6.8-beta.</p>
<p>Trying to avoid becoming cocky, I completed the instructions in the README, and updated the NSLU2-Linux Wiki to reflect my experiences).  Once all of this was done, I had &#8220;unslung&#8221; my NSLU2 to the drive USB drive attached to it &#8211; or, in less jargonny terms, I had changed the unit&#8217;s settings so that no longer did it boot entirely from the build-in flash memory, afterwards mounting the USB drive separately for sharing, but instead it used the built-in memory as some kind of low-level bootstrap system to mount the USB disk as the root filesystem, and then booted from that.  That probably sounds more complicated than it is &#8211; all I really needed to do was robotically follow the instructions in the README.</p>
<p>So, now that&#8217;s all installed, the next step is to install Ruby.  </p>
<p>Next: <a href="http://www.gilesthomas.com/?p=12">Installing Ruby on an Unslung NSLU2</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gilesthomas.com/?feed=rss2&amp;p=11</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project: Automated offsite backups for an NSLU2 &#8211; part 6</title>
		<link>http://www.gilesthomas.com/?p=10</link>
		<comments>http://www.gilesthomas.com/?p=10#comments</comments>
		<pubDate>Sat, 11 Nov 2006 23:12:06 +0000</pubDate>
		<dc:creator>giles</dc:creator>
				<category><![CDATA[NSLU2 offsite backup project]]></category>

		<guid isPermaLink="false">http://www.gilesthomas.com/?p=10</guid>
		<description><![CDATA[Previously in this series: Part 1, Part 2, Part 3, Part 4, Part 5.
I now know that in order to get automated offsite backups from my NSLU2 to Amazon S3, I have to get it to run Ruby so that it can run s3sync.  I want to back everything up first, which is going [...]]]></description>
			<content:encoded><![CDATA[<p>Previously in this series: <a href="http://www.gilesthomas.com/?p=5">Part 1</a>, <a href="http://www.gilesthomas.com/?p=6">Part 2</a>, <a href="http://www.gilesthomas.com/?p=7">Part 3</a>, <a href="http://www.gilesthomas.com/?p=8">Part 4</a>, <a href="http://www.gilesthomas.com/?p=9">Part 5</a>.</p>
<p>I now know that in order to get automated offsite backups from my <a href="http://www.linksys.com/servlet/Satellite?c=L_Product_C2&#038;childpagename=US%2FLayout&#038;cid=1115416906769&#038;pagename=Linksys%2FCommon%2FVisitorWrapper">NSLU2</a> to <a href="http://aws.amazon.com/s3">Amazon S3</a>, I have to get it to run <a href="http://www.ruby-lang.org/en/">Ruby</a> so that it can run <a href="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=11975&#038;start=0&#038;tstart=0">s3sync</a>.  I want to back everything up first, which is going to take some time &#8211; so while that&#8217;s happening, I&#8217;ll get both Ruby and s3sync installed on an Ubuntu Linux machine as a dry run.</p>
<p>Firstly, I need to download s3sync from its <a href="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=11975&#038;start=0&#038;tstart=0">homepage</a>, and unzip/untar it into a convenient directory.</p>
<p>The next step is to install Ruby.  The machine I am using to test this is running Ubuntu 6.10 (&#8221;Edgy Eft&#8221;), and to install standard packages on it you use a tool called Synaptic Package Manager.  This has somewhat conflicting information regarding Ruby.  The basic package &#8211; called, unsurprisingly, <tt>ruby</tt> &#8211; claims to be version 1.8.2, and s3sync requires 1.8.4 or higher.  There is also a <tt>ruby1.8</tt> package, which appears to be version 1.8.4-5ubuntu1.1, so that sounds like it might be a good one to use.  However, it states in its notes that &#8220;on Debian, Ruby 1.8 is provided as separate packages.  You can get full Ruby 1.8 distribution by installing following packages.  ruby1.8 ruby1.8-dev&#8221; etc.  Most of the listed packages do not show up in the package manager.  To make things even more confusing, the ruby package appears to depend on the <tt>ruby1.8</tt> one, which implies that it actually <em>is</em> version 1.8.4&#8230;   To keep things simple, I installed the <tt>ruby</tt> package, and then typed <tt>ruby ----version</tt> at the command line; it told me that it was version 1.8.4.  OK.</p>
<p>The next step was to see if let&#8217;s see if I could sync something with my S3 account.  John Eberly has kindly <a href="http://blog.eberly.org/2006/10/09/how-automate-your-backup-to-amazon-s3-using-s3sync/">blogged</a> the details of how he set up s3sync on his system, and it&#8217;s clear that setting up a bucket on S3 in advance using a separate application is a good idea; so, I downloaded <a href="https://jets3t.dev.java.net/cockpit.html">jets3t Cockpit</a> as he suggests and tried it out.  (Note &#8211; you need <a href="http://java.sun.com/">Java</a> 1.4 or higher installed to run it &#8211; as an old Java hand using a newish machine, I was surprised to notice that I&#8217;d not yet installed it on my workstation.  That&#8217;s what switching to <a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython">IronPython</a> does to you.)</p>
<p>The jets3t Cockpit is a pretty simple app &#8211; you can set up multiple logins in a &#8220;saved login&#8221; screen, or you can log in directly using the Access Key ID/Secret Access Key that Amazon provide.  Once you&#8217;re logged in, it is pretty trivial to create a new bucket &#8211; and, because all S3 buckets exist in the same namespace (even across users!), it sensibly suggests bucket names that start with your user ID.  So, I created a bucket called <tt>&lt;my-access-key-id&gt;.Test</tt></p>
<p>Now, let&#8217;s see if we can backup the s3sync install directory itself over to S3.  Firstly, s3sync needs to know the access key ID and secret key:</p>
<pre>
# export AWS_ACCESS_KEY_ID=&lt;my key ID&gt;
# export AWS_SECRET_ACCESS_KEY=&lt;my key&gt;
</pre>
<p>And now, we can run the sync:</p>
<pre>
# ./s3sync.rb -r . &lt;my key ID&gt;.Test:aprefix
</pre>
<p>The first time I tried this, it failed &#8211; the Ruby files are not +x&#8230; <i>Grumble</i>.  OK, trying again:</p>
<pre>
# chmod +x *.rb
# ./s3sync.rb -r . &lt;my key ID&gt;.Test:aprefix
</pre>
<p>Hmmm.  I got an error message:</p>
<pre>
./S3.rb:25:in `require': no such file to load -- openssl (LoadError)
</pre>
<p>Interesting.  Wild guesswork followed: I know that the default package list of Ubuntu does not contain the full list of available packages &#8211; just those that are strictly Open Source (for some value of &#8220;Open Source&#8221;).  I had a vague memory from somewhere, some time back, that OpenSSL has some odd licensing restrictions.  Perhaps the Ruby SSL package is not part of the standard Ruby package because of this?  That might also be the case with the other parts of the Ruby distribution mentioned in the note to the <tt>ruby</tt> package I mentioned above &#8211; which would explain why they were missing from the package manager.</p>
<p>Working on this basis, I checked my Settings/Repositories dialog in the package manager, and noted that it was only looking at the &#8220;main&#8221; source of software &#8211; &#8220;Canonical supported Open Source software&#8221;.  I set the checkboxes for the &#8220;universe&#8221; and &#8220;multiverse&#8221; sources as well &#8211; for community-maintained packages and those with copyright restrictions &#8211; and searched for OpenSSL packages.  Bang &#8211; I got the <tt>libopenssl-ruby1.8</tt> package, which had not previously been visible.  I installed it and tried again&#8230;</p>
<p>&#8230;and the result was better, but still not great &#8211; this time I got a 403 &#8220;Access forbidden&#8221; error.  My first guess was that I must have mistyped either the access key ID or the key itself&#8230;. but further inspection (and a copy/paste to make absolutely sure) showed that that was not the case.  Another thought occured to me &#8211; it might be a problem with simultaneous access from jets3t Cockpit and from s3sync, so I tried shutting the former down &#8211; but to no avail.</p>
<p>OK, time to investigate.  A quick check on the <a href="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=11975&#038;start=75&#038;tstart=0">thread</a> where the script was announced showed that one other person was getting the same response (you can see his comment if you search for &#8220;403&#8243;), but it was because he&#8217;d not replaced the string &#8220;bucket&#8221; in the sample command line with his bucket name &#8211; whoops.  However, his second post, a little further down, gives an example of a call to a lower-level script that simply sends an S3 command and shows the result.  I decided to try something like that:</p>
<pre>
# ./s3cmd.rb -dv list &lt;my key ID&gt;.Test 200
</pre>
<p>&#8230;and I got a message saying that there is too much of a clock skew between the &#8220;request time&#8221; and the current time.  A quick check, and &#8211; aha! &#8211; my Ubuntu box&#8217;s clock is out by half an hour O_o.  Fixing that, and then re-running the list command made it work! </p>
<pre>
# ./s3cmd.rb -dv list &lt;my key ID&gt;.Test 200
list &lt;my key ID&gt;.Test: 200  {}
--------------------
200
Trying command list_bucket &lt;my key ID&gt;.Test max-keys 200
prefix   with 100 retries left
Response code: 200
#
</pre>
<p>So, I retried the s3sync, and it returned with no output &#8211; a fine Unixy way of saying that it thinks it succeeded.    I checked what I had stored in the bucket on on S3 using jets3t Cockpit&#8230;. and w00t!  It was all there, with sensible keys.  </p>
<p>Next, I waited for a few minutes, then ran the command again to see if it really was synchronising rather than simply copying.  Of course, it was hard to be sure &#8211; but the command returned much more quickly than last time, and the file timestamps on S3 didn&#8217;t change their modified time &#8211; which would seem to imply that it didn&#8217;t try to re-write them.</p>
<p>As a final check, I touched one of the files, and synced again&#8230; but it was just as quick and there was no update to the modified time.  Thinking that perhaps it was using hashes rather than the update time <sup>[<a href="#note-1" name="ref-1">1</a>]</sup>, I tried changing the file using vi and syncing again&#8230; and this time the command took slightly longer to return, and the modified time updated.</p>
<p>At that point I decided I was confident that s3sync was working as it should &#8211; and conveniently, the backup had completed.  So it was time for the next step &#8211; installing the <a href="http://www.nslu2-linux.org/wiki/Unslung/HomePage">Unslung</a> firmware on the slug.</p>
<p>Next: <a href="http://www.gilesthomas.com/?p=11">Installing Unslung</a>.</p>
<p><sup>[<a name="foot-1" href="#ref-1">1</a>]</sup> After perusing the <a href="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=11975&#038;start=0&#038;tstart=0">thread</a> on the Amazon site more closely, I discovered that yes, it does use hashes &#8211; it compares the MD5 of the file with a hash stored on S3 that happens to be the MD5.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gilesthomas.com/?feed=rss2&amp;p=10</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project: Automated offsite backups for an NSLU2 &#8211; part 5</title>
		<link>http://www.gilesthomas.com/?p=9</link>
		<comments>http://www.gilesthomas.com/?p=9#comments</comments>
		<pubDate>Sat, 11 Nov 2006 22:13:19 +0000</pubDate>
		<dc:creator>giles</dc:creator>
				<category><![CDATA[NSLU2 offsite backup project]]></category>

		<guid isPermaLink="false">http://www.gilesthomas.com/?p=9</guid>
		<description><![CDATA[Previously in this series: Part 1, Part 2, Part 3, Part 4.
In order to get automated offsite backups from my NSLU2 to Amazon S3, I&#8217;ve determined I need to use s3sync, a Ruby script.  Obviously, this means that I need to get Ruby running on the &#8220;slug&#8221;.
As I noted earlier, the standard firmware will [...]]]></description>
			<content:encoded><![CDATA[<p>Previously in this series: <a href="http://www.gilesthomas.com/?p=5">Part 1</a>, <a href="http://www.gilesthomas.com/?p=6">Part 2</a>, <a href="http://www.gilesthomas.com/?p=7">Part 3</a>, <a href="http://www.gilesthomas.com/?p=8">Part 4</a>.</p>
<p>In order to get automated offsite backups from my <a href="http://www.linksys.com/servlet/Satellite?c=L_Product_C2&#038;childpagename=US%2FLayout&#038;cid=1115416906769&#038;pagename=Linksys%2FCommon%2FVisitorWrapper">NSLU2</a> to <a href="http://aws.amazon.com/s3">Amazon S3</a>, I&#8217;ve determined I need to use <a href="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=11975&#038;start=0&#038;tstart=0">s3sync</a>, a <a href="http://www.ruby-lang.org/en/">Ruby</a> script.  Obviously, this means that I need to get Ruby running on the &#8220;slug&#8221;.</p>
<p>As I noted earlier, the standard firmware will not support Ruby, so the first step is going to have to be to install new firmware.  The <a href="http://www.nslu2-linux.org/wiki/FAQ/FirmwareMatrix">matrix of possibilities</a> on the NSLU2-Linux site lists a bunch.  My gut instinct is to stay as close to the original firmware &#8211; to the left of the matrix &#8211; as possible.   I&#8217;ve been using Linux for a long time now &#8211; on and off since 1992 &#8211; but I&#8217;ve never really got to a serious kernel-recompiling porting-it-to-a-<a href="http://en.wikipedia.org/wiki/ZX81">ZX81</a> level with it.  So let&#8217;s keep things as simple as possible.</p>
<p>Conveniently, it looks like <a href="http://www.nslu2-linux.org/wiki/Unslung/HomePage">Unslung</a>, the most simple replacement firmware, and one that is compatible with the original firmware &#8211; hopefully meaning that I won&#8217;t need to do anything like reformat the disk I currently have attached &#8211; has some level of support for Ruby.  At least, there is a Ruby package in the <a href="http://ipkg.nslu2-linux.org/feeds/optware/nslu2/cross/stable/">list of &#8220;cross packages&#8221;</a>.  Brief investigation implies that I may have to compile the package myself &#8211; hence the &#8220;cross&#8221; &#8211; but hopefully that won&#8217;t be too tricky.</p>
<p>Before doing anything else, I need to safeguard my data.  Although it&#8217;s all backed up on the IBackup system I mentioned <a href="http://www.gilesthomas.com/?p=5">earlier</a>, it&#8217;s better to be safe than sorry &#8211; so, the first step is to copy it all over to my main workstation&#8217;s hard drive.</p>
<p>Once this is done, it&#8217;s time to install.  There is a <a href="http://www.nslu2-linux.org/wiki/Unslung/NewUsersGuide">new user&#8217;s guide</a> on the NSLU2-Linux site with strict instructions to follow the README, which lives next to the binaries on <a href="http://www.slug-firmware.net/">Slug-Firmware.net</a> &#8211; they have a complicated click-through license that I shan&#8217;t deep-link past.   The README is very detailed, and is full of dire warnings about the consequences of not following it.</p>
<p>As it will take a while to back up the drive, let&#8217;s try out s3sync on a regular Linux box while we wait.</p>
<p>Next: <a href="http://www.gilesthomas.com/?p=10">s3sync on Ubuntu</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gilesthomas.com/?feed=rss2&amp;p=9</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Project: Automated offsite backups for an NSLU2 &#8211; part 4</title>
		<link>http://www.gilesthomas.com/?p=8</link>
		<comments>http://www.gilesthomas.com/?p=8#comments</comments>
		<pubDate>Sat, 11 Nov 2006 19:25:51 +0000</pubDate>
		<dc:creator>giles</dc:creator>
				<category><![CDATA[NSLU2 offsite backup project]]></category>

		<guid isPermaLink="false">http://www.gilesthomas.com/?p=8</guid>
		<description><![CDATA[Previously in this series: Part 1, Part 2, Part 3.
I am trying to get my NSLU2 to back itself up automatically to Amazon S3.   I currently know that in order to get this to work, the &#8220;slug&#8221; (as it&#8217;s affectionally known) will need to be upgraded with new firmware &#8211; basically, a new [...]]]></description>
			<content:encoded><![CDATA[<p>Previously in this series: <a href="http://www.gilesthomas.com/?p=5">Part 1</a>, <a href="http://www.gilesthomas.com/?p=6">Part 2</a>, <a href="http://www.gilesthomas.com/?p=7">Part 3</a>.</p>
<p>I am trying to get my <a href="http://www.linksys.com/servlet/Satellite?c=L_Product_C2&#038;childpagename=US%2FLayout&#038;cid=1115416906769&#038;pagename=Linksys%2FCommon%2FVisitorWrapper">NSLU2</a> to back itself up automatically to <a href="http://aws.amazon.com/s3">Amazon S3</a>.   I currently know that in order to get this to work, the &#8220;slug&#8221; (as it&#8217;s affectionally known) will need to be upgraded with new firmware &#8211; basically, a new version of Linux.  Just which of the many competing firmwares is appropriate will depend on the software I use to do the sync, and so it&#8217;s time to work through the various options presented in <a href="http://jeremy.zawodny.com/blog/archives/007641.html">Jeremy Zawodny&#8217;s post</a> and the comments people have left there.</p>
<ul>
<li>Firstly, we have <a href="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=11975&#038;start=0&#038;tstart=0">s3sync</a>.  This appears to be hosted at the S3 site, which is promising.  However, it&#8217;s written in <a href="http://www.ruby-lang.org/en/">Ruby</a>.  I have nothing against the language &#8211; indeed, it&#8217;s next on the list of languages I want to learn &#8211; but it&#8217;s not precisely lightweight, and so would almost certainly mean that I cannot fit the complete boot image for the OS into its firmware; some stuff will need to go on the disk, and that feels somehow&#8230; inelegant.  If the other options have the same constraint, then maybe this will be the one to go for.  But for now I&#8217;ll see if there&#8217;s anything more lightweight.
<li><a href="http://www.backup-manager.org/">Backup Manager</a> looks like a nice tool for building full backups, which can then be pushed offsite.  It&#8217;s written in <a href="http://www.gnu.org/software/bash/">Bash</a> and <a href="http://www.perl.org/">Perl</a> &#8211; the latter meaning that it would probably require as much stuff to be installed on the machine as Ruby would, so a bit of a problem there.  When you combine this with the fact that it&#8217;s not really designed for simple synchronisation with offsite systems, it doesn&#8217;t sound quite like the kind of thing I&#8217;m looking for.
<li><a href="http://www.carion.org/s3dav/index.html">S3DAV</a> does just what you&#8217;d expect it to do &#8211; it creates a <a href="http://en.wikipedia.org/wiki/WebDAV">WebDAV</a> interface to your S3 account.  This looks interesting.  It&#8217;s written in <a href="http://java.sun.com/">Java</a>, so would require quite a lot of stuff to be installed on the NSLU2 (I&#8217;m beginning to see a pattern here) and would require some kind of rsync-to-WebDAV software on top, however &#8211; so potentially more work than, say s3sync.  Worth keeping an eye on, though, especially because&#8230;
<li>&#8230;of <a href="http://www.nongnu.org/duplicity/">Duplicity</a>, which uses the rsync algorithm to produce &#8220;bandwidth-efficient&#8221; archives.  Unfortunately, it&#8217;s not quite ready for prime-time: it &#8220;should continue to work fine until you depend on it for your business or to protect important personal data&#8221;.  Again, one to check at a later date, perhaps.
<li>Similarly, <a href="http://dev.extensibleforge.net/wiki/s3/fuse">Fuse</a> looks like it might be usable in some time &#8211; but &#8220;[n]o warranties and if you screw up then don&#8217;t blame me, this is pre-alpha code meaning it might not work or worse screw up your system.&#8221;  So probably not safe for non-PC hardware.
<li><a href="http://www.sync2s3.com/">Sync2S3</a> looks like a nice tool, but is closed-source Windows-only.
<li>&#8230;as is <a href="http://www.maluke.com/s3man/">S3 Backup</a>&#8230;
<li>&#8230;and <a href="http://www.bigsafebox.com/">BigSafeBox</a>&#8230;
<li>&#8230;and <a href="http://www.altexa.com/">Altexa</a>&#8230;
<li>&#8230;<a href="http://jungledisk.com/faq.shtml">JungleDisk</a> does support Linux, but it&#8217;s closed-source with a binary distro &#8211; so I doubt it could be persuaded to work on the ARM processor on the NSLU2&#8230;
<li>&#8230;and finally, <a href="http://supersync.com/">SuperSync</a> seems to be designed for music files only.
</ul>
<p>So, for my fairly low-level simple needs, it looks like there&#8217;s one clear winner &#8211; <a href="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=11975&#038;start=0&#038;tstart=0">s3sync</a>.  This is going to need stuff to be installed on the NSLU2, but that&#8217;s true of any other option I saw.</p>
<p>The next steps?  To play with s3sync on a regular Linux box so that I can work out how it is meant to operate normally, and to get a Ruby platform up and running on the NSLU2.  The latter is likely to be the more difficult, so I&#8217;ll start looking at that first.</p>
<p>Next: <a href="http://www.gilesthomas.com/?p=9">Upgrading the firmware &#8211; a first look</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gilesthomas.com/?feed=rss2&amp;p=8</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
