Make Viscosity connect automatically, when a Time Machine backup starts?

Is there a way for Viscosity to automatically establish a connection, when my Mac starts a Time Machine backup? I have a sufficiently fast inbound connection to my home network that it would be feasible to do Time Machine backups, when away from home.

Is there a way for this to trigger the connection to my home network? Perhaps any attempt to connect to a specific IP address?

Hi Dominik,

I’m afraid it isn’t really possible. While it would be theoretically possible to use pf (macOS’s firewall) to trigger an action based on a packet match, that wouldn’t solve the problem, as the connection to the Time Machine file share would have already failed. It would be necessary to man-in-the-middle and intercept the connection and keep it alive until the VPN connection is active.

You’re likely better off having a script that runs periodically (you can set it as a hourly or daily cron job for example) that does the following:

  1. Checks if you’re on your home network, and if so exits
  2. Connects the VPN connection
  3. Triggers a Time Machine backup
  4. Optionally disconnect the VPN connection

Instructions for connecting a Viscosity VPN connection can be found at:
https://www.sparklabs.com/support/kb/article/controlling-viscosity-with-applescript-mac/

You can call the command “tmutil startbackup -b” in your script to trigger a Time Machine backup:
https://www.unix.com/man-page/osx/8/TMUTIL/

Cheers,
James

Thank you very much, James! I only now turned on email notifications. Before, I had not seen that you had responded.