Skip to content

BrianHenryIE/UnmountVolumeAfterTimeMachine

Repository files navigation

Unmount Volume After Time Machine

Automatically eject USB disks after Time Machine backup completes.

Launches when a USB disk is inserted and exits after Time Machine completes.

To avoid:

disk-not-ejected-properly.png

Quickly install via yonaskolb/MintA package manager that installs and runs Swift command line tool packages.

brew install mint
mint run BrianHenryIE/UnmountVolumeAfterTimeMachine

Background Items Added.png

mint uninstall BrianHenryIE/UnmountVolumeAfterTimeMachine 

Originally requested as a feature for nielsmouthaan/ejectify-macos but not implemented in that now-archived project.

Uses BrianHenryIE/SwiftTimeMachine and BrianHenryIE/BHSwiftOSLogStream to parse Time Machine logs and query tmutil for status. When the backup job completes, the disk is ejected with DADiskUnmount.

TODO:

  • App should run when disk plugged in / Time Machine starts and quit when the disk is ejected emorydunn/LaunchAgent
  • When the app launches upon a disk being inserted, it should exit quickly if the disk is not used for Time Machine
  • What happens the app tries to unmount after Time Machine but other files are being copied in Finder?
  • Disks should be re-mounted as per the Time Machine schedule
  • Some sort of UI/checkbox to enable/disable/communicate the app is present and running apple/swift-argument-parser
  • Notifications when the disk is ejected
  • Make available via brew
  • Currently, a race condition is possible that would cause the app to exit after another disk was unmounted (tiny window, fraction of a second)
  • Check is the app already running

Build and run

swift build -c release
./.build/release/UnmountVolumeAfterTimeMachine

About

Automatically eject USB drives after TimeMachine backup finishes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages