How to automatically eject external drive after Time Machine runs

6

I have a MacBook Pro which I regularly dock to an external monitor.

I have my mouse, keyboard, and iPhone dock, and an external hard drive connected via a USB hub so that I only have to make one USB connection when docking.

The external hard drive is used for Time Machine backups. Every time I undock, I simply unplug the single USB cable. Unfortunately this causes a warning message that says that I should remember to eject the external hard drive before unplugging it.

What I would like to know is if there is a way that I could have it automatically eject the external hard drive each time after Time Machine runs.

I usually undock and redock at least once a day so the next time it is docked, the drive will be re-mounted and then Time Machine could run while the system is docked.

Avalanchis

Posted 2010-07-15T16:21:40.520

Reputation: 612

Seems like this defeats the purpose of Time Machine since it is meant to backup at regular intervals so long as the drive is mounted. – fideli – 2010-07-15T17:33:26.527

Yes, but it usually gets docked once a day so it is still able to backup periodically. I'm not sure what the default interval is but it seems to back up once a day or so. – Avalanchis – 2010-07-15T17:45:29.367

Once an hour. It might remove hourly backups from the backup disk to preserve disk space, though. – Daniel Beck – 2011-01-23T18:06:59.480

Answers

2

I found a free and useful downlaod that does this:

Time Machine Scheduler

It mounts and unmounts the drive automatically on schedule (and when you boot up, if you ask it to). Also allows a custom schedule other than every hour. It installs a new pref panel to control this. Only downside is that the old TM pref panel does not display everything exactly right anymore -- timestamps are off by a few minutes, it says Time machine is Off even when backups are happening -- but it completely solves the pesky improper ejection issue.

Ted

Posted 2010-07-15T16:21:40.520

Reputation: 21

1

You could do a backup using the terminal and eject using the terminal. Then put the commands into a script.

John

Posted 2010-07-15T16:21:40.520

Reputation: 1 101

I would upvote this answer if you repeated the details in your answer. It's fine to link to other sources, but other sources have a habit of going away... – Dannid – 2017-08-08T16:22:49.180

1

I have the exact same setup as you, and had the same problem. I would suggest trying SuperDuper, a backup system for Mac's. The paid version includes scheduling, scripting, backup on connect, eject after copy, and more. It also has the ability to work alongside Time Machine, and can create bootable backups.

Aaron Mahan

Posted 2010-07-15T16:21:40.520

Reputation: 111

0

Assuming you are doing this unplug while the Mac is asleep, you could use Sleepwatcher from this page, combined with the command:

diskutil eject <disk name>

which can run when the machine goes to sleep. Thus, whenever you sleep your Mac, you will eject the drive.

On the other hand, if you've been unplugging this drive while the machine is awake...is ejecting it really so hard?

Lukasa

Posted 2010-07-15T16:21:40.520

Reputation: 1 995