Start time machine backup when attaching a HD

How do I start the backup straight away when attaching the external hard drive.

I want to start a backup with Time machine each time I attach a certain external HD.
I know how to get the time machine dialogue up and running when attaching this HD. My problem is that I want to start the backup in the same was as when I click on the Time Machine symbol in the top bar and click on the “make backup know” (or whatever it’s called in the english version).

You can use a Volume Mounted trigger to detect the device appearing.

And then you can start the backup, either using GUI scripting or the shell command.

Best would probably be Execute Shell Script: tmutil startbackup --auto

1 Like

I tried your suggestion - as in the screen capture - but nothing happened.
I made a pause, while the HD is loading, but the backup is not starting.
Is the syntax ok? I’ve never tried scripting before.
See: http://www.screencast.com/t/uc6VoHhH9I

Today - when I waited a little longer, the backup started. Everything seems to be ok.
I think I was fooled to believe that it should start up immediately and did not wait, as I saw no immediate activity.

Thanks a lot!

Just for my curiosity: Is there a way to unmount the HD when the backup is finished (which may vary very much in time…)?

Still a problem. It only works if the power cable is attatched. Which is not always the case - on my MacBook…

Is there a way around this??

Try removing the “–auto”? It may be Time Machine does not start in Automatic mode unless it is powered?

It works Excellent!

Thank you.

I’m following the same.

Is there any way to unmount the drive when backup is finished and have a pop up notification saying that backup has now finished and it’s safe to unplug the usb.

Thanks.

You can have the macro wait until the tmutil command is not running.

Something like this:

For this sort of thing, where it is going to go for a long time, and there is no need for a rapid response at the end, using a While loop with a long pause will cause less CPU/Battery drain than will a Pause Until which will check the continuation at a very high rate, needlessly wasting CPU and battery.

1 Like