Skip to content

Neved4/tmbackup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

32 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Shell Script macOS

tmbackup - Seamless Time Machine backups! πŸš€

Fast, light macOS utility that performs Time Machine backups on all connected drives.

Generated using agg, asciinema, Menlo typeface, theme Github Dark.

Highlights

  • πŸš€ Fast - minimal overhead, tmbackup.awk executes in only ~ 15 ms.1
  • 🎨 Intuitive - user-friendly, clear color-coded messages for every backup status.
  • πŸ”’ Robust - ensures reliability with effective error handling during the backup.
  • πŸ“¦ Self-contained - no dependencies, lightweight, uses POSIX awk, sh (e.g. 3629 bytes, 186 lines).

Getting Started

Note

This utility is only intended to work in macOS.

Installation

If you have brew installed, just run:

$ brew install Neved4/tap/tmbackup

Usage

$ ./tmbackup.sh

Logging

tmbackup | tee -a /path/to/output.log

Compatibility

Supported macOS Versions

Version Supported
macOS 14 Sonoma Yes βœ…
macOS 13 Ventura Yes βœ…
macOS 12 Monterey Yes βœ…
macOS 11 Big Sur Yes βœ…
Supported Awk and UNIX shells

tmbackup is built for macOS using /bin/sh and /usr/bin/awk. It adheres to standards when possible, and is made to play nicely with other Awk and POSIX sh versions too.

This allows to execute tmbackup with different shells:

dash /path/to/tmbackup.sh

Or to build your own parsing with different Awk implementations:

tmutil destinationinfo | mawk -f /path/to/tmbackup.awk

Supported Awk implementations

Shell Version Supported
awk 20230909 βœ… Yes
gawk 5.3.0 βœ… Yes
goawk 1.25.0 βœ… Yes
mawk 1.3.4-20231126 βœ… Yes

Supported shells

Shell Version Supported
bash 5.2.15 βœ… Yes
dash 0.5.12 βœ… Yes
ksh93 93u+m/1.0.7 βœ… Yes
mksh 59c βœ… Yes
oksh 7.3 βœ… Yes
osh 0.18.0 βœ… Yes
posh 0.14.1 ❌ No
yash 2.55 βœ… Yes
zsh 5.9 βœ… Yes

UX & Implementation

More information on this topic: UX.md.

Note

If you have any cool ideas or suggestions to improve things, let me know!

Limitations

Important

tmbackup does not differentiate between backups interrupted by a hardware failure and a user manually skipping.

Acknowledgments

Thanks to @0risc and @goldbuick for testing and feedback.

License

tmbackup is licensed under the terms of the MIT License.

See the LICENSE file for details.

Related Projects

Footnotes

  1. Tested with hyperfine. ↩