Skip to content

Neved4/tmbackup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 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.