I am trying to develop a strategy to protect a 2016 iMac against ransomware and other types of malware. I have several assumptions:

  1. An infection is going to occur when I am using it. Things such as clicking on an infected email or website.
  2. If the computer can be compromised, then any drive that can be accessed through Finder (iCloud, Drobox, OneDrive, Google Docs or USB drive) can be compromised also.
  3. I can back up to a USB drive, then disconnect it. I am looking for something more automatic. (easier) Something I can't mess up or forget to do.

Could I schedule a USB drive to Mount/Unmount at a scheduled time with Automator and then set Time Machine to backup during that time?

  • 2 am mount USB drive
  • 2:30 am Time Machine back up.
  • 5 am unmount USB drive
  • You could limit the threat potential by uninstalling Flash, Silverlight & Java too. I retain Chrome with it's built-in Flash if I simply must visit a Flash-required location.
    – Tetsujin
    Apr 20, 2017 at 19:46

1 Answer 1


For the mounting unmounting part you can simply use the commands

diskutil mount HDD UUID

for mounting the USB disk and

diskutil unmount HDD UUID

You can get the UUID selecting the drive or partition in Disk Utility and clicking on "Info".

For the Time Machine part, you could use TimeMachineScheduler it let you change the interval of backups and also set time where no backups are to be done.

Let us know if that worked for you, or if not let us know more info about what version of OS X you are running etc!


You must log in to answer this question.

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