Norbert Hartl

mostly brackets and pipes

Backup and Encryption I: Backup

I use a laptop for my professional work. That means I have stuff on the laptop that I don’t want to lose neither by disk crash nor by theft. So the most basic thing you have to do (and too many people do ignore) is a backup. This at least ensures you that you don’t lose your stuff.

Working for other companies you also don’t want others to get the stuff you didn’t lose. Working like this puts encryption next to the backup. It is really essential to protect your customers property while working for them. Backup and encryption used alone are easy to achieve on a Mac. But if you want the combination of both than you are lost.This is the first of two blog entries focussing on the backup side.

In the next article you can read how you can do encryption on your Mac and how backup and encryption can be combined.


Using time machine for backups is great. The default behaviour of time machine is doing backups every hour as long as your power supply is plugged in (at least this is my case). All of the backups are incremental managed. The behaviour of keeping old backups is a logarithmic one. You have hourly backups for the last day, daily backups for the last week, weekly backups for the last month and monthly backups for the last year. I’m not sure if it is always the last period or the last two but you got the glimpse, right?

Time machine is also an application to access your backups. You select an application window like the Finder and entering time machine shows you a couple of finder windows stacked one after the other. The finder windows display the states of the filesystem at the particular time. You can go into the past and back again. Using the mouse you can select any files you like to restore and voila….easy. It is really easy to use and therefor the best backup software I’ve ever seen. But it has also drawbacks.

disk space

Time machine is eating up disk space really fast. So you need to have big wallet to upgrade disk drives everytime free space is becoming rare. Or you can be a little careful. Just one example. Let’s assume you copied your 80GB mp3 collection into your home folder into a folder copyFromOldDisk. Than you leave your Mac alone. While it is so magically done in the background you didn’t notice that time machine backuped your folder. Than you move the folder to MyMusic. And magically time machine stores this folder happily, too. A little bit later you decide to put your music folder on your new NAS so the whole family can use it. After copying you remove the MyMusic folder from your drive. The next time you check disk space for the time machine you might wonder that the space time machine occupied is huge.

In such a situation you can clean your backup a bit. Just enter the time machine scroll to the time the MyMusic folder existed. If you do it right the folder will appear in the Finder window. Select it and press right mouse button. There is an option to remove this folder from all backups. Time machine will go though all of the backup states and erase it. Erasing the second folder gives you back your 160GB disk space.You did that and checked the disk space again and nothing happened? Well, it’s not like that. You need to know that there is a slightly difference between the space time machine uses and the space that is used on your disk. Time machine stores its data in disk image. It is like a virtual hard disk made up of files. This disk image can only grow automatically. If time machine needs more space it grows the image. If you delete the mentioned two folders than there are 160GB free space inside the image but the size of the image on your hard disk stays the same.

shrinkingBad? No!

I just said it can’t shrink automatically. But you can shrink it manually. Make sure your disk image isn’t used right now (used over network or locally). Then open a terminal and type

hdiutil compact /path/to/your/time/machine/image

This will shrink the image and frees your disk space.


Apple defined for you what you like to back up. A standard set has been defined. You can add things to exclude via the time machine configuration dialog but not in a sophisticated manner. If you want to include something you are lost again. Exclusions defined by Apple are configured in a file


Using an editor that is capable of editing plist file (I use TextWrangler for that) you can alter the set time machine includes/excludes