Apple Time Machine With Custom AFP Port 2019-08-30 link

I have a nice setup where my computers can back up with Time Machine to an AFP share over IPv6. Unfortunately I have to travel to locations that don't provide IPv6 connectivity, which means that my computer doesn't always back itself up.

To prevent this from happening I've tried to change my backup location to an AFP share with an IPv4 address but on a custom port so it can be NATted. This does not seem to be well supported as out of the box as Time Machine will fail to mount the AFP share.

You can set up Time Machine with a custom port as follows:

  1. Go to Finder.
  2. Mount your AFP fileshare with Command+K.
  3. Go to Time Machine properties.
  4. Click on your mounted file share.
  5. (optional but recommended) Check 'Encrypt backups'
  6. Press Ok
  7. Enter your password
  8. Open the Keychain Access application
  9. Search for an entry for your file share with Time Machine Password as type.
  10. Double click on it to edit it.
  11. Name should be something like:
  12. Where should be something like: afp://
  13. Change name to:<port>
  14. Change where to: afp://<port>/Fileshare
  15. Click Save Changes

Useful commands:

  • Tail the time machine log: log stream --style syslog --predicate 'senderImagePath contains[cd] "TimeMachine"' --info
  • Command line interface: tmutil
  • Time Machine manpage: man tmutil