cat /dev/brain > blog

yet another weblog – by Sven A. Schmidt

Archive for the ‘mac’ Category

autotm 0.94 supports local backups

leave a comment »

As introduced in a previous blog post, autotm is an OSX system daemon that automatically switches Time Machine targets depending on their availability. The initial version of autotm only supported network based targets but I’ve recently updated the script to also allow locally connected disks (e.g. USB). This update requires some minor changes to your autotm.conf file: The server section is now called “destinations” and each destination has a “type”, which can be remote or local. For example:

destinations:
 - type: remote
   hostname: myhomeserver.local
   username: jdoe
   password: s3cr3t
 - type: remote
   hostname: myofficeserver.local
   username: john_doe
   password: pa55 
 - type: local
   volume: /Volumes/Time Machine

To learn more about autotm, have a look at the Readme on Github. Please file any problems you encounter on the issue tracker at github!

Thanks to Andy and Daniel for their help in testing this release!

Advertisement

Written by sas

January 2, 2012 at 10:01

Posted in mac, osx

Tagged with

Automatic Time Machine Switching

with 6 comments

With the ubiquity of mobile computer and especially their dominance among Apple’s product offerings, it’s probably a very common set-up for people to use a MacBook both at home and at the office. This gives you a lot of flexibility and avoids having to maintain two installations — which can take a lot of time, depending on the amount of customization you’re applying to your machine. You bring your machine and therefore never have to sit down at an out-of-date computer.

There’s one problem though: Do you also carry along your time machine backup? Because if you don’t, and you spent a significant amount of time at either location, there will be large gaps and opportunities for failure in your backup schedule. (Yes, there’s mobile time machine but I see that as an option when you’re really on the road. A same disk backup is not truly a backup, it’s more like “Trash on steroids”.)

So what are the options? You could carry an external disk around and use that for backups. The problem with this is, though, that it takes a lot of discipline to hook it up every time you sit down in one place in order for the hourly time machine backups to happen. Part of the beauty of time machine is that, if it’s configured to back up to a network volume, you never have to do anything for it to kick in. All you need to do is enter you wifi zone.

Another reason an external disk is not ideal is the fact that it’s not redundant in itself. It’s just a single disk and single disks fail. Ideally, a time machine backup sits on a RAID-5 or some other redundant configuration – none of which is going to be portable.

In my opinion, the ideal solution to this is to have a time machine set-up at each location where you spend a significant amount of time and which you get switched to automatically on joining the respective network. When I saw the macosxhints article about using two time machine backups a few days ago, I knew that all the bits were there to set this up. However, I didn’t want to install extra tools like the article describes (MarcoPolo) and therefore I wrote a little ruby script that does everything automatically.

The script is available at github. The readme file explains most of the details but in a nutshell autotm does the following:

  • autotm looks at your system.log to determine if the last backup failed
  • if it failed, autotm will go through the list of configured servers to look for an alternative
  • if multiple servers respond to pings, autotm will pick the fastest one (your office server may be visible via a presumably slower VPN connection for example but you want to avoid backing up there from home)
  • if your last backup was successful but the server is not available anymore autotm will check for alternatives and pick the fastest one, as described above

So essentially, all you have to do is set up two (or more) time machine backups for you machine and then record their details in the config file. The LaunchDaemon will then trigger autotm every 30 minutes to check if it needs to switch time machine targets without any action required on your end.

Written by sas

September 22, 2011 at 11:09

Posted in mac

Tagged with ,

Coffee Disaster

leave a comment »

It was bound to happen. I spend countless hours tapping away on my MacBook Pro and I drink lots of coffee while I’m at it. So inevitably, as always when chances are small but opportunities abundant, disaster struck and I managed to pour half a cup of Rosabaya de Columbia on my Macbook’s keyboard. Don’t ask for details. Let’s leave it at too lazy to walk twice, balancing too many things, and the presence of gravity.

So I ended up with half a cup of coffee on the WASD area of my keyboard plus some on the trackpad, going for the edges. What do do? I went for:

  1. Calming down by shouting expletives
  2. Turning the laptop upside down
  3. Shutting it down
  4. Fetching a vacuum cleaner to suck out coffee, while holding the machine upside down (a situation man apparently doesn’t find himself in very often, or evolution would have had us develop a third arm)

Initially that didn’t help much. After rebooting I found that some keys appeared to work while others didn’t. It took me a moment to realize that actually all keys worked except the ‘fn’ key, which was ‘stuck’ in the on position. Or rather coffee remains bridged it into a pressed state and it wouldn’t go.

In a situation like that you find out things you never would otherwise, like:

  • fn + cursor keys does nothing – even though fn + pretty much any other key sends the key
  • I never missed forward delete, on the contrary I’m a backspace guy (fn pressed will turn backspace into forward delete and drive you mad)
  • keys with state are a nightmare and I love the fact that you can turn off caps lock on Lion
  • speaking of caps lock, why is it even there and why didn’t it break instead of ‘fn’ (ok, I wouldn’t notice even if it had, actually)
  • the keys can be removed rather easily (revealing things better left unseen…)

and finally:

  • the aluminum bluetooth keyboard actually fits perfectly on top of a unibody 15″ MBP

The battery compartment fits nicely into the dent above the function keys and thanks to the identical key size and layout you end up with a nice piggy-back set-up that you can actually work with:

Strap-on Keyboard

The even better news is that after a day of drying, the ‘fn’ key has decided to get stuck in the ‘off’ position. That means I can’t control the brightness nor the volume from the keyboard right now but at least the rest of it is back to normal.

-sas

Written by sas

August 17, 2011 at 18:08

Posted in mac

Tagged with , ,