I currently have my Time Machine sparse bundle residing on a network drive plugged in to my router. I have a script that runs at login that auto connects to the shared drive and mounts the sparsebundle image as a device for backups. Here's what it looks like:

   mount volume "smb://readyshare/MacBackup"
end try

do shell script "hdiutil attach -mountpoint /Volumes/MacBackup/ /Volumes/MacBackup/TimeMachine.sparsebundle"

However, I've noticed that from time the time the device will automatically disconnect itself. Usually this happens when I leave for lunch and the MacBook Pro goes to sleep after a while.

Often I don't notice this until I get an error message about my backup device not being able to perform the backup.

Is there a way I can modify this script (or create a new one) that can detect when my sparsebundle device has been ejected and remount it?

1 Answer 1


Nowadays you can point Time Machine directly at a network share and it should handle this for you automatically. Maybe your question relates to an older version of macOS.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .