Auto unmount time machine drive on sleep
You can use ioreg to test if your lid is closed or open:

ioreg -r -k AppleClamshellState | grep AppleClamshellState


No= Lid is open
Yes= Lid is closed

You can use diskutil unmount /dev/&lt;mydisk&gt; to unmount the TimeCapsule.
Use diskutil list to find the disk location of the TimeCapsule.

Using if statements you can automate the job:

if [[ $(ioreg -r -k AppleClamshellState | grep AppleClamshellState | grep Yes) ]]; then echo Lid Closed; diskutil unmount /dev/&lt;mydisk&gt;; fi


You can use launchd to set up a automated job that is repeated for example every second (see how to here: http://alvinalexander.com/mac-os-x/mac-osx-startup-crontab-launchd-jobs)