Feb 032009

For those of you who don’t know, JungleDisk is a utility that allows you to back up data to Amazon’s Simple Storage Service (S3).  Soon, it will also allow you to use Mosso’s Cloud Files service, which is similar to S3 but hosted by RackSpace. I recently won a free subscription to JungleDisk, thanks to Mosso.

I’ve got JungleDisk set up on my Windows machine and it’s working really well. I was looking around the JungleDisk website, and I noticed that you’re allowed to install the desktop edition on as many computers as you want.  I’ve got two machines here at home – my laptop with Windows, and my file server running FreeBSD.  JungleDisk doesn’t have a native FreeBSD version, but they do offer a Linux version.  Seeing as FreeBSD does have a Linux compatibility layer, I figured I’d at least try to get it to work.  So far, I’ve been moderately successful.

Update, November 2009: I am no longer using JungleDisk to back up my FreeBSD box.  Jungledisk recently released version 3.0 of their software which does not include a command-line Linux version in the standard desktop edition.  I was advised to stick with the old version if I want to continue backing up.  Instead, I chose to change over to Duplicity.  I will write a post on Duplicity in the near future.

Before I go on, I must have a disclaimer:  This is not at all supported by JungleDisk and if you choose to try this, you’re doing so at your own risk.  This works fine for me, but your mileage may vary.  I am not in any way responsible for any costs this may incur to you, or any damage this may cause.

Basic Steps

  1. Install FreeBSD’s linux_base-fc4 package if it’s not already there.
  2. Download JungleDisk – both the Linux version and the multi-platform USB Edition.
  3. Use the USB edition on Windows, Mac or Linux to create your base configuration file.
  4. Copy the configuration file to your FreeBSD system.
  5. Set up a cron job to schedule backups.

Detailed Instructions

First, if you didn’t install the Linux compatibility layer, install it via your ports collection:

# cd /usr/ports/emulators/linux_base-fc4
# make install clean

This may take a while, there are lots of packages to install.

Next, download both the Linux version and the “USB Edition” from http://www.jungledisk.com/desktop/download.aspx.  You’ll use the Linux command-line version on your FreeBSD machine, and you’ll use the Windows, Mac or Linux GUI version from the USB distribution to create your initial configuration file.  I’m on Windows, so my examples and screen shots for this part will reflect that, but I’d imagine the GUIs are similar in the other supported OSes.

Extract the JungleDisk USB file, and then run the Jungle Disk Monitor application from the folder you extracted everything to.  You should see the beginning of the Wizard.

Jungle Disk Beginning of Wizard

Click “Next” – enter your Amazon S3 account information.


Select your license – if you purchased a Jungle Disk license, this is where you’ll put in that account information.


Choose “Configure JungleDisk for Automatic Backup”


Choose “Create a New Bucket”


Enter a name for the new bucket and select the type of security you’d like to use.


Use the defaults – Manual Only.


Select some random subdirectories of your C: drive – it doesn’t matter which ones, but I recommend selecting the same number of directories as you plan on backing up (this will help you when modifying the config file later).


JungleDisk will now start up – you can go ahead and exit.

In the folder where you ran JungleDisk from, there will now be a file called jungledisk-settings.xml.

It should be noted at this point that FreeBSD will run JungleDisk in a chroot’d environment – meaning that the “/” directory, as far as JungleDisk is concerned, is really /compat/linux.  Don’t forget this!

To get around this, I wrote a simple shell script to copy all of the files I want to back up into /compat/linux/backup.  This will show up as “/backup” to JungleDisk, so that’s the folder we’ll set it up to back up.

Now, edit your config file and look for something along these lines:

Change the contents of the <directoryName> tag to /compat/linux/backup, and change the <basePath> to /backups/HOSTNAME/backup.  I believe the <basePath> tag in the XML is the path within Amazon S3 that this will be stored in, but I’m not terribly familiar with how that works.  It should look something like this – my server’s hostname is DARKHELMET.

Also, look for the tag <jobName> – this will tell you the name of the backup job, which you’ll need in a minute.  I believe the default is “My Backup”

Now, extract the JungleDisk tarball somewhere on your FreeBSD box.  Right now, my copy is in /home/dave/jungledisk.

Copy the jungledisk-settings.xml into the same directory.

Become root, and run JungleDisk:

The -f causes JungleDisk to stay in the foreground, and the -d will print debug messages.  Finally, –exit will make JungleDisk exit when it’s done.

If all goes well, you should see a TON of output… but the result should be that everything’s backed up.  You can use the Windows version of JungleDisk to browse your files.

You can now integrate all of this into a shell script that copies all of your files into /compat/linux/backup and runs JungleDisk.  Then maybe set a cron job for it.

Something else to note – I really haven’t studied the configuration file very much, so I’m not really sure what everything does.

Happy backups!