Code, Camera, Action

Stories, software and strategies to help nonprofits do web 2.0+ 
Filed under

backup

 

Full Disk Restore from Time Machine Backups - Over the Network

Turns out Time Machine is not just for accidentally deleted files — it works great for restoring a Mac from bare metal, too. Even over the network.

James Duncan Davidson’s instructions for using theOSX Leopard install DVD to boot and restore from a Time Machine backup work great if you back up to aUSB or FireWire drive.

But I use Time Machine over the network, so my backup set wasn’t available. Nedospasov had the secret for mounting the network backup share first.

Here’s the whole process:

1. Boot from the installer DVD. Choose “Options…” to get the Utilities menu

2. Utilities > Disk Utility to partition the disk the way you like it

3. Utilities > Restore System from Backup… If your Time Machine backup set appears, then restore away. While there’s a button here to connect to a remote disk, that option wasn’t clickable for me. So we’ll have to mount our network volume manually.

4. Utilities > Terminal Run this command to mount your backup volume manually (substitute your username, password, and so forth):

mount -t afp afp://username:password@hostname/ShareName /Volumes

5. Utilities > Restore System from Backup… and you should now be able to choose your Time Machine backups.

Wait for System Restore to do it’s thing. Over my 100Mb network, it took about four and a half hours to restore 80G. WiFi would require even more patience.

Once the restore is done, you’ll be asked to reboot. And then, ta-da — just about everything will be back just the way it was. A couple of exceptions: Mail will rebuild it’s cache the first time you start it. You’ll have to re-authorize iTunes. And if you use Web Sharing, Apache won’t start because its log directory isn’t restored.

To fix Web Sharing, recreate Apache’s log directory. From Terminal, run this command:

sudo mkdir /private/var/log/apache2

And that’s all. At least for OSX 10.5.3. While Time Machine does not give you a bootable external drive the way that a backup with SuperDuper! might, Time Machine support baked into the OSX install DVD makes this a great option. With Time Machine we get file versioning and disaster recovery. Way to go, Apple!

Loading mentions Retweet
Filed under  //   backup   leopard   os x   time machine  

Comments [0]

JungleDisk 2.0 Gets Compatible S3 Buckets, Horray

The folks at JungleDisk released version 2.0 Monday. This is a major — and welcome — upgrade.

  • Redone graphical interface with lots more options for what to back up and when
  • Smoother handling of multiple buckets
  • Standard bucket and folder naming, so you can use your JungleDisk S3 data with other software like S3Fox
    • This requires converting your existing buckets to JD 2 format — which means that every machine accessing your JungleDisk must run version 2

Of course the Linux command line tools are still there for all of you rsync fans.

We’ll be updating our command-line configurations in the coming days. In the meantime, you can download the update from JungleDisk. It’s free for registered users.

Loading mentions Retweet
Filed under  //   backup   jungledisk  

Comments [0]

A Fix for Time Machine on OSX 10.5.3 over AFP for .mac Users

So the Mac OS X 10.5.3 update broke Time Machine for me.

The update did fix Time Machine backups over the network for many people, but not for me. Lots of folks have tried various things to fix the problem (like standing on their head, reformatting, fingering prayer beads). Here’s what fixed Time Machine over AFPfor me.

I had a setup that was backing up perfectly on 10.5.2.

  • MacBook connected to wifi network
  • Mac Mini with external drive
  • A shared folder on the Mini’s external drive (called “backups”) that was the Time Machine backup target. This folder contains the sparse bundle holds all the MacBook’s backups
  • Access to the Mini’s “backups” share was through a .Mac login
    • Here’s how I knew that: Browsing to Mini in Finder shows “Connected as: blahblah@mac.com” in the gray bar
    • And the local usernames on the two machines were different (the same .Mac login accessed harold on the MacBook and freddy on the Mini)

After the 10.5.3 update, Time Machine said “The backup volume could not be mounted” — again and again. Console’s system log showed backupd errors 18 and sometimes 19.

Worse, I couldn’t choose “backups” as the destination for Time Machine. As it turns out, there are two problems with this setup that Leopard 10.5.3 doesn’t like — even though 10.5 through 10.5.2 were fine with it.

  1. 10.5.3 Time Machine now apparently can’t use a share accessed by a .mac login
    • At least when they point to different local usernames. Let us know in the comments if it works for you with .mac at all
  2. Permissions on previous sparse bundle backups now seem to confuse Time Machine
    • Again, this is likely due to the .mac credentials

I was able to fix the first of these problems and work around the second both problems, which got Time Machine backing up over the network.

I am so far unable to access previous Time Machine backups, though, so I’m still experimenting with the second.

Fixing Problem Number 1 – Connect as you you, not .mac you

  1. On MacBook, start System Preferences, and choose Time Machine
  2. “Change disk”, and select “None”
    • This turns Time Machine backups off for now.
    • Some folks say you need to reboot now
  3. On MacBook unmount any of Mini’s shares
  4. Over on Mini, share your backup share with both your user and Administrators; both need Read & Write access
  5. Back on MacBook, connect to “backups” on Mini as your username
    • The .Mac user is the default, so you’ll probably need to disconnect, then connect as yourself
  6. On MacBook, start System Preferences, and choose Time Machine
  7. “Change disk”, and select “Backups (mini)”
    • “Backups” should be in the list now. If not, reboot and start from step 4.
  8. Enter your username and password. With this, Time Machine will be able to mount your share automatically when it’s ready to back up
  9. Try to “Back up now” in Time Machine

If it works, congratulations, you’re done. For me, it didn’t — probably because the previous .mac login connected as different users on Mini and MacBook. Since you’re not likely to have such a bizzarro-world setup, you’re probably home free. Let us know in the comments.

Fixing Problem Number 2 – sparsebundle permissions

Because of my .mac username hijinks (the same .Mac login accessed harold on the MacBook and freddy on the Mini), I still couldn’t back up.

Console told me I was now getting backupd error 18 in system.log:

/System/Library/CoreServices/backupd: Volume at path /Volumes/Backups-1 does not appear to be the correct backup volume for this computer. (Cookies do not match)
/System/Library/CoreServices/backupd: Backup failed with error: 18

In theory, changing permissions on the sparsebundle to MacBook’s user ought to work. Only it didn’t for me.

Instead, I moved the sparsebundle on Mini to another folder. From there, MacBook’s Time Machine backed up just fine, though any backups made under 10.5.2 or earlier are lost.

Update 1 Jun: It does work, but I had to change two things to get access to the old backups.

  1. Give the local user read and write permissions on the sparsebundle. Use Finder on the Mini to do this, as ACLs are involved. It will take a long time.
  2. From Terminal on Mini, change ownership of the sparsebundle to the local user (use your username in place of “eric” and your sparsebundle name in place of “greatnorthern…”):
sudo chown -R eric greatnorthern_0017f2f16a4e.sparsebundle

After this, backups over wifi worked — though the first backup took a very very long time preparing.

The good news? 10.5.3 is much smarter about network backups. Time Machine will mount the share automatically when it’s time to back up — or when you enter Time Machine. For a laptop, Time Machine backups are now truly seamless.

If only the upgrade was painless!

6 Comments on the Original Post

I get the msg “operation not supported” when I try to change owner.

The problem as I see it is that Finder and via Time Machine mount the backup disk in different ways. If I open it in finder, it lists the permissions as belonging to the user. When Time Machine mounts the disk, it is listed as belonging to Root.

This explains the console messages I’m getting about backup daemon not having permissions:

5/29/08 5/29 | 11:32:10 PM /System/Library/CoreServices/backupd148 Backup requested by user 5/29/08 5/29 | 11:32:10 PM /System/Library/CoreServices/backupd148 Starting standard backup 5/29/08 5/29 | 11:32:10 PM /System/Library/CoreServices/backupd148 Network mountpoint /Volumes/sean not owned by backupd… remounting 5/29/08 5/29 | 11:32:12 PM /System/Library/CoreServices/backupd148 Failed to remount network volume. 5/29/08 5/29 | 11:32:17 PM /System/Library/CoreServices/backupd148 Backup failed with error: 19

..I wonder if I should connect to my Airport Disk as a user rather than with a disk password. But when I consider changing, Airport Utility gives me the warning that I won’t be able to see the data on the drive.

Thank you for the support on this site, nearly there I feel, but not quite.

S

one more thing: if I open the airport disk AND time machine opens the disk, I get TWO disks attached: backup AND backup-1

S

Hi Sean —

Two things may be worth trying —

1. What happens if you give “Administrators” read & write access to the share and the sparsebundle?

2. Alternately, it may be worthwhile connecting to the airport disk as a user — but my guess is you’d have to change the share to give read & write access to that user. And you’d probably have to make the sparsebundle owned by that user, too.

This is what I did to get backups to my desktop Mini working.

But I don’t have an airport myself, so I can’t help you experiment there.

Does the airport’s warning message give you any hints?

Eric,
from what I’ve read on the mac forum
http://discussions.apple.com/thread.jspa?messageID=7291724

… it’s not as simple as changing the permissions on the sparsebundle.

I think the only way to be the same owner as the share is to log on as a user: I didn’t want to have my airport disk set up this way, and also there’s a scary message when I consider changing, that I won’t be able to read data already on the drive.

I think the problem occurs because TM accesses the disk in a new way. If the volume “Backup” is already mounted, it mounts “Backup-1” but then fails to be able to read and write to it. And if, say, iTunes tries to do the same, it hasn’t got write privileges either. The only workaround I have at the moment is to keep mounting and unmounting the disk manually!

Many thanks for the reply Eric. Hoping you/Apple come up with a solution!

Sean

Tried the fix posted here – still not working properly. 
I’ve just downloaded airport utiliity 5.3.2 – still not fixed.

How to reproduce:
restart mac: click on time machine, ‘back up now’. Time machine will fail (can’t mount disk). If I open the airdisk (connect to the folder, as guest, so it shows the ‘eject’ icon), it will also fail.

If I open then eject the airdisk, it works. But this is a bit of a ‘pullahvah’ as we say in the UK.

Sean

I’m trying this with an airport extreme, no TC and get

6/20/08 1:02:36 AM kernel AFP_VFS afpfs_mount: /Volumes/TMDrive, pid 8649 6/20/08 1:02:50 AM kernel AFP_VFS afpfs_unmount: /Volumes/TMDrive, flags 0, pid 8671 6/20/08 1:03:15 AM /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder151 SharePointBrowser::handleOpenCallBack returned 80 6/20/08 1:03:35 AM kernel AFP_VFS afpfs_mount: /Volumes/TMDrive, pid 8649 6/20/08 1:03:37 AM kernel AFP_VFS afpfs_unmount: /Volumes/TMDrive, flags 0, pid 8676 6/20/08 1:03:37 AM /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder151 SharePointBrowser::handleOpenCallBack returned -5002 6/20/08 1:03:53 AM kernel AFP_VFS afpfs_mount: /Volumes/TMDrive, pid 8649 6/20/08 1:04:00 AM /System/Library/PrivateFrameworks/Admin.framework/Resources/writeconfig8653 Warning: accessing obsolete X509Anchors. 6/20/08 1:04:19 AM /System/Library/CoreServices/backupd8684 Backup requested by user 6/20/08 1:04:19 AM /System/Library/CoreServices/backupd8684 Starting standard backup 6/20/08 1:04:19 AM /System/Library/CoreServices/backupd8684 Network mountpoint /Volumes/TMDrive not owned by backupd… remounting 6/20/08 1:04:20 AM /System/Library/CoreServices/NetAuthAgent.app/Contents/Resources/NetAuthSysAgent8685 Warning: accessing obsolete X509Anchors. 6/20/08 1:04:20 AM /System/Library/CoreServices/backupd8684 Failed to remount network volume. 6/20/08 1:04:25 AM /System/Library/CoreServices/backupd8684 Backup failed with error: 19

This is perplexing. I’m starting with a newly formatted disk on the AE and it does this. Should I try doing a full backup to the local mount first to have a sparsebundle to begin with?

Loading mentions Retweet
Filed under  //   backup   leopard   os x   time machine  

Comments [0]

Configuring JungleDisk on Linux - Revisited

We’ve updated our earlier howto JungleDisk for Linux Server Backups without X11 for the latest version of JungleDisk, 1.50.

  • The new version is more reliable for transferring lots of files, and rsync works better.
  • Rsync’s —archive flag now works as expected (though you still need —inplace).
  • jungledisk now uses Fuse directly rather than davfs, so prerequisites are different
  • The command-line jungledisk program now mounts by itself
  • The configuration file gets a bunch of new options

So check out our updated instructions for configuring JungleDisk 1.50 from the command line.

Still clinging to the past? The you can read our original instructions for JungleDisk versions 1.30 to 1.40.

Loading mentions Retweet
Filed under  //   backup   jungledisk   linux   post  

Comments [0]

Time Machine Backups over WiFi

Leopard does not (yet?) backup to a disk attached to an Airport base station, to lots of people’s concern. But OS X version 10.5.1 will backup over the network — to another Mac. It works just fine over wired or wifi networks, so it works for MacBooks.

Initial setup is easy.

On the host Mac: Plug in your external drive. Turn on File Sharing from System Preferences (AFP, the default, is what you want). Share a directory on your external drive where you’ll store the backups.

On the Mac you want to back up: Mount the backup share. Then go to Time Machine in System Preferences, and turn it on. When it asks you for a backup destination, select your backup share.

Each time you backup…

Time Machine then needs two things before it will backup your MacBook:

  1. Plug the laptop into a power supply. Time Machine won’t start a backup if you’re running on battery power.
  2. Mount the share that holds your backups. (Double-click on it in Finder.)
  3. Done. Time Machine will back up on schedule, so you can keep working. But if you’re anxious, you can also start the backup by picking “Back Up Now” from the Time Machine icon.

I find these two steps to be much more convenient than plugging the external drive into the laptop, and I hope you will, too.

Update 31 May 2008: Since Leopard 10.5.3, Time Machine no longer requires any of this — it mounts backup shares when needed, so you don’t have to do anything. Once you get Time Machine working again, that is. If you’re having troubles since the 10.5.3 update, readA Fix for Time Machine on OSX 10.5.3 over AFP for .mac Users, a how-to that will get you going again.

Loading mentions Retweet
Filed under  //   backup   leopard   os x   time machine  

Comments [0]

Economics of Online Backup

Photographer James Duncan Davidson takes a look at The Economics of Online Backup — and finds that time and cost work against online storage for his terabyte of data.

Worth a read. The comments mention some of the solutions we’ve tried here at el Studio — Mozy and JungleDisk/S3 — and also some that we haven’t, like CrashPlan.

With any online backup plan, the crucial issue may not be how many GB of stuff you’ve got overall, but rather how frequently that data changes.

Perhaps it’s fine if it takes a week to upload your stuff to, say, Mozy. But if, like Davidson, you find yourself producing 3 days worth of uploads every afternoon — then online backup probably isn’t the best choice.

Loading mentions Retweet
Filed under  //   backup  

Comments [0]

JungleDisk for Linux Server Backups without X11

JungleDisk is another great entrant in the online backup business. Unlike Mozy, our favorite for Macs and PCs, JungleDisk also runs on Linux. And, since version 1.30a, it ships a command-line version.

Which means you can give your Linux servers reliable online backup — stored on Amazon’s S3.

These instructions cover version 1.50 — which has a different config file and a number of settings than previous versions. If you’re still using an older version, see the instructions for version 1.30 or 1.40 that we published a while back.

Meanwhile, let’s get down to business with version 1.50. Our server install has three parts:

  • JungleDisk command line program, which makes S3 look like a WebDav server
  • Fuse, which makes WebDav look like a regular Linux filesystem
  • rsync, the standard Linux power copy program

You’ve got rsync, and the other two aren’t much harder to install.

1. Install Fuse

  1. Install Fuse. On Ubuntu Dapper this is easy once you enable the Universe repository. Later versions of Ubuntu have fuse-utils in the regular repositories.
    	sudo apt-get install fuse-utils
    	sudo modprobe fuse
    
  2. To keep JungleDisk happy, we’ll load the fuse kernel module automatically on boot.
    	sudo echo “fuse” >> /etc/modules
    

2. Install JungleDisk

  1. Download JungleDisk, and untar it. Since version 1.30a, the Linux package comes with both GUI and command-line versions.
    • jungledisk is the command-line version we’ll use here
    • junglediskmonitor is the GUI version. This version makes it easy to sign up for S3, and it writes the config file for you automatically — but you’ve got to have X11 installed to run it :(.
  2. Sign up for an Amazon S3 accountjunglediskmonitor can help you do this — if you’ve got X-windows installed. The junglediskmonitor also creates a settings file.
  3. Or if you install JungleDisk on a Mac or Windows PC you can copy the config from that install. (On a Mac, the config can be found here: ~/Library/Preferences/jungledisk-settings.ini)
  4. You could also use a different machine to run the USB-key version of JungleDisk, which lets you run the graphical setup on a Mac or PC and writes the settings back to the USB drive.
  5. Or you can make your own ~/.jungledisk/jungledisk-settings.ini. You’ll need to put your Amazon S3 access and secret keys and your username in place of the*<removed>* text below:
1 LoginUsername=
2 LoginPassword=
3 AccessKeyID=<removed>
4 SecretKey=<removed>
5 Bucket=default
6 CacheDirectory=/tmp/.cache/
7 ListenPort=2667
8 CacheCheckInterval=120
9 AsyncOperations=1
10 Encrypt=0
11 ProxyServer=
12 EncryptionKey=
13 DecryptionKeys=
14 MaxCacheSize=50
15 MapDrive=J
16 UseSSL=1
17 RetryCount=3
18 FastCopy=1
19 WebAccess=0
20 LogDuration=0
21 ArchiveFlag=5
22 ArchiveDuration=60
23 MaxArchiveSize=100
24 PasswordPrompt=0
25 UploadResume=0
26 DeltaUpdates=0
27 PlusFallback=1
28 LargeWindows=0
29 License=

You can download a sample config file without the line numbers. A couple of lines will need editing to fit your circumstances.

Lines 3 and 4 are your Amazon S3 credentials. Copy and paste them from Amazon’s website. (Click the button labled “Your Web Services Account”, then choose “AWS Access Identifiers” to see these.)

Line 6: The directory where JungleDisk will write to while its processing. This needs to exist and be writable by the user who will run jungledisk.

Lines 1, 2 and 29 can be left blank (as they are here) for your 30-day trial of JungleDisk. Once you buy the software, however, you’ll want to fill them in. Lines 1 and 2 are the email address and password you used to make your JungleDisk purchase.

Line 29 is a license code generated by junglediskmonitor. I’m not aware of a way to produce this in the command-line client. The Mac OS X version of JungleDisk keeps the license in the keychain, where Keychain Access can show it. If anybody knows where to find this in Windows, please let us know in the comments.

3. Actually Try it Out

Time to try it all out.

  1. Get ready to mount the jungledisk drive (first time)

    sudo mkdir /mnt/s3
  2. Start jungledisk (/mnt/s3 is the mount point you just created)

    ./jungledisk/jungledisk /mnt/s3
  3. Actually copy something over to S3

    echo “Here’s a file to try” > atestfile.txt
    sudo cp atestfile.txt /mnt/s3

4. Rsync Backups

If you don’t love rsync yet, you’re gonna. Can you say “Differential Copy algorithm”? Rsync only copies the changed stuff. And that’s what makes over-the-net backups workable.

Here’s how to back up the whole enchilada (or at least all of your server’s /home directories).

rsync -a --inplace --bwlimit=50 /home /mnt/s3

Notice that the rsync command adds a bandwidth limit (—bwlimit=50) to the inplace flags that JungleDisk recommends. Without this, you may find that jungledisk opens more files than the kernel will allow (at least in Ubuntu).

5. Automated Backups

And here’s the shell script we use to actually do the backup. Line 5 here shows that we’ve got one more choice here — when to start jungledisk. It could be done in line 5 here, but because it’s a background process we want to leave running, we could start it on bootup by adding the jungledisk command to the end of /etc/rc.local.

/usr/local/bin/backup-jd

1  #!/bin/sh
2  ### Backs up office data to Jungledisk using rsync
3  LOGFILE=/var/log/backup-jd.log
4  ## Start in rc.local or here
5  /usr/local/bin/jungledisk /mnt/s3
6  echo "`date +"%F %R"`: Start backup-jd" >> $LOGFILE
7  rsync -a --inplace --bwlimit=50 /home /mnt/s3
8  echo "`date +"%F %R"`: Finish backup-jd" >> $LOGFILE

Updates & Revisions

8/14/07: Originally published.

8/19/07: Add line numbers and a better explanation of the JungleDisk config file, plus a version for download.

4/18/08: Updated for JungleDisk version 1.50. The original post is here for anyone still using JungleDisk 1.30 or 1.40.

1 Comment on the Original Post

Thanks, great post. Now have automated backups running on my homeserver, plus a network drive I can access from the office too!

Loading mentions Retweet
Filed under  //   backup   code   how to   jungledisk   linux  

Comments [0]

Online Backups

We’ve been testing online backup software here at el-Studio for a while now. Remarkable how the slipping of the little rubber band inside our tape drive — the one that connects the motor with the thingy that spins the tape — brings online backups to mind.

Plus there’s the appeal of saying “We backup to the cloud, man.”

Anyway, our favorite online backup software/service is Mozy.

First, we could tell by the way the folks at Mozy write that they feel our pain:

Alternatives to Mozy

  • Burn a new CD or DVD every Sunday night and store them at your brother-in-law’s office.
  • Pay $200/year for an online backup service that uses old, mediocre software.
  • Buy a $200 external hard drive and hope your office doesn’t burn down.
  • Do nothing and don’t worry about backup. (We suggest closing your eyes, plugging your ears and repeating “I’m in my happy place, I’m in my happy place.”)
  • Run a cron job of rsync, gzip and mcrypt piped over ssh to your friend’s server over his DSL line.

 

That last option, by the way, isn’t so bad. For one server. Until your friend’s IP address changes.

But Mozy, it turns out, backs up really well — the best set-and-forget backup software we’ve seen.

We use the Mac version of their software, which is still in beta. Here’s how it works —

  1. Download the software and install it
  2. Pick the files you want to back up
  3. Let it run. In the background. Automatically.

That’s it. First run will take quite a while (like days) — but you can work normally in the meantime. And after that, the software runs whenever your machine sits idle for a bit.

Restores are a matter of going to the Mozy website and using an online file picker. You can download the results — or, if you want, Mozy can FedEx you a DVD.

Cost? Free for 2G, or $5/month for unlimited storage.

Or if you use this link to Mozy, you’ll tell ‘em we sent you — and they’ll throw in an extra quarter gig for free.

Aside in the voice of a media outlet: We have no financial stake in Mozy, and don’t know anybody there. And, as paying customers, that Mozy code gets us nothing. We just like their software. If you’re in the market for online backup, you might, too.

Cautions

Mac Mozy is beta software, and there have been some issues with earlier versions.

That said, versions since 0.5.1 have worked for us (latest as of this writing is 0.6.0). And the software does update itself.

Besides the beta software issue, there are a couple of things worth thinking about before relying on Mozy:

  • Online means that somebody else could get to your data. While Mozy encrypts your backups — using a key you provide, if you wish — its web-based restore can mean these are only as secure as your password.
  • Backups are saved at a single data center in Salt Lake City. Redundancy here would be nice.

But for us, the software’s ease-of-use — and the tape drive’s slipping rubber band — trump these concerns.

We backup to the cloud, man.

Loading mentions Retweet
Filed under  //   backup   os x  

Comments [0]

JungleDisk for Linux Server Backups - Version 1.30-1.40

JungleDisk is another great entrant in the online backup business. Unlike Mozy, our favorite for Macs and PCs, JungleDisk also runs on Linux. And, since version 1.30a, it ships a command-line version.

Which means you can give your Linux servers reliable online backup — stored on Amazon’s S3.

Here’s more about how JungleDisk works.

Meanwhile, let’s get down to business. Our server install has three parts:

  • JungleDisk command line program, which makes S3 look like a WebDav server
  • DavFS, which makes WebDav look like a regular Linux filesystem
  • rsync, the standard Linux power copy program

You’ve got rsync, and the other two aren’t much harder to install.

1. Install DavFS

  1. Install davfs2. On Ubuntu Dapper or later this is easy once you enable the Universe repository.

    sudo apt-get install davfs2
  2. To keep JungleDisk happy, we’ll add this line to the bottom of /etc/davfs2/davfs2.conf:

    kernel_fs fuse

    That tells davfs to use the newer Fuse backend instead of Coda, which avoids a JungleDisk bug.
  3. For other linux distributions, see Chris’s instructions for installing davfs2 from source

2. Install JungleDisk

  1. Download JungleDisk, and untar it. Since version 1.30a, the Linux package comes with both GUI and command-line versions.
    • jungledisk is the command-line version we’ll use here
    • junglediskmonitor is the GUI version. This version makes it easy to sign up for S3, and it writes the config file for you automatically — but you’ve got to have X11 installed to run it :(.
  2. Sign up for an Amazon S3 accountjunglediskmonitor can help you do this — if you’ve got X-windows installed. The junglediskmonitor also creates a settings file.
  3. Or if you install JungleDisk on a Mac or Windows PC you can copy the config from that install. (On a Mac, the config can be found here: ~/Library/Preferences/jungledisk-settings.ini)
  4. Or you can make your own ~/.jungledisk/jungledisk-settings.ini. You’ll need to put your Amazon S3 access and secret keys and your username in place of the*<removed>* text below:
	
 1 LoginUsername=
 2 LoginPassword=
 3 AccessKeyID=*<removed>*
 4 SecretKey=*<removed>*
 5 Bucket=default
 6 CacheDirectory=/home/*<removed>*/.jungledisk/cache/
 7 ListenPort=2667
 8 CacheCheckInterval=120
 9 AsyncOperations=1
10 Encrypt=1
11 ProxyServer=
12 EncryptionKey=PROTECTED:
13 DecryptionKeys=PROTECTED:
14 MaxCacheSize=1000
15 MapDrive=
16 UseSSL=0
17 RetryCount=3
18 FastCopy=1
19 WebAccess=0
20 LogDuration=30
21 License=

You can download a sample config file without the line numbers. A couple of lines will need editing to fit your circumstances.

Lines 3 and 4 are your Amazon S3 credentials. Copy and paste them from Amazon’s website. (Click the button labled “Your Web Services Account”, then choose “AWS Access Identifiers” to see these.)

Line 6: The directory where JungleDisk will write to while its processing. This needs to exist and be writable by the user who will run jungledisk. Most folks should just put their Linux username in place of *<removed>*.

Lines 1, 2 and 21 can be left blank (as they are here) for your 30-day trial of JungleDisk. Once you buy the software, however, you’ll want to fill them in. Lines 1 and 2 are the email address and password you used to make your JungleDisk purchase.

Line 21 is a license code generated by junglediskmonitor. I’m not aware of a way to produce this in the command-line client. The Mac OS X version of JungleDisk keeps the license in the keychain, where Keychain Access can show it. If anybody knows where to find this in Windows, please let us know in the comments.

3. Actually Try it Out

Time to try it all out.

  1. Start jungledisk

    ./jungledisk/jungledisk
  2. Mount the jungledisk drive

    sudo mkdir /mnt/s3
    sudo mount -t davfs -o nolocks,noaskauth http://localhost:2667 /mnt/s3
  3. Actually copy something over to S3

    echo “Here’s a file to try” > atestfile.txt
    sudo cp atestfile.txt /mnt/s3

4. Rsync Backups

If you don’t love rsync yet, you’re gonna. Can you say “Differential Copy algorithm”? Rsync only copies the changed stuff. And that’s what makes over-the-net backups workable.

Here’s how to back up the whole enchilada (or at least all of your server’s /home directories).

rsync -r --inplace --size-only --bwlimit=50 /home /mnt/s3

Notice that the rsync command adds a bandwidth limit (—bwlimit=50) to the inplace and size-only flags that webDAV and JungleDisk recommend. Without this, you’ll find that jungledisk opens more files than the kernel will allow (at least in Ubuntu).

5. Automated Backups

To schedule this stuff automatically, we’ll need to add a couple of lines to some of our config files. First we add a line to the end of fstab that lets our backup user mount our jungledrive (use sudo to carefully add this line).

/etc/fstab

http://localhost:2667  /mnt/s3  davfs   user,nolocks,noaskauth   0   0

And here’s the shell script we use to actually do the backup. Line 5 here shows that we’ve got one more choice here — when to start jungledisk. It could be done in line 5 here, but because it’s a background process we want to leave running, we could start it on bootup by adding the jungledisk command to the end of /etc/rc.local.

/usr/local/bin/backup-jd

1  #!/bin/sh
2  ### Backs up office data to Jungledisk using rsync
3  LOGFILE=/var/log/backup-jd.log
4  ## Start in rc.local or here
5  #/usr/local/bin/jungledisk
6  mount /mnt/s3
7  echo "`date +"%F %R"`: Start backup-jd" >> $LOGFILE
8  rsync -r --inplace --size-only --bwlimit=50 /home /mnt/s3
9  echo "`date +"%F %R"`: Finish backup-jd" >> $LOGFILE
10 umount /mnt/s3

Updates & Revisions

8/19/07: Add line numbers and a better explanation of the JungleDisk config file, plus a version for download.

Loading mentions Retweet
Filed under  //   backup   code   how to   jungledisk   linux  

Comments [0]