Status | Meaning |
---|---|
green 🟢 |
Backup finished successfully. |
red 🔴 |
Backup was interrupted or drive was disconnected. |
yellow 🟡 |
Warning demanding user attention. |
blue 🔵 |
Ongoing backup or general information. |
magenta 🟣 |
Miscellaneous information. |
gray ⚪️ |
Backup drive or destination not available. |
Tip
Over time, tmbackup
generates numerous local snapshots that will be
trimmed but not removed. If you know what you're doing, you can remove
local snapshots by scheduling rmlsnaps()
.
Simplifying the script into terse functions is possible, but tmbackup
prioritizes an intuitive and user-friendly approach. The goal is that at
any point in time, users have a clear picture of the state of their
backups.
Restructuring it into functions may lead to confusion. One notable example
is the default behavior of tmutil startbackup
. See tmback()
's output
below:
Total copied: 0.00 MB (0 bytes)
Avg speed: 0.00 MB/min (0 bytes/sec)
Total copied: 0.00 MB (0 bytes)
Avg speed: 0.00 MB/min (0 bytes/sec)
Total copied: 0.00 MB (0 bytes)
Avg speed: 0.00 MB/min (0 bytes/sec)
Compare it to tmbackup
's output instead:
Complete: 4F4B520B-C151-485D-8CD9-6EB53E8FAAE4 (Backup 1)
Total copied: 69.34 MB (72704000 bytes)
Avg speed: 74.97 MB/min (1310283 bytes/sec)
Offline: CF9A4D94-2A57-40A1-B843-A8DA64A5858D (Backup 2)
Stopped: F49B059C-5944-49C9-A96D-53DCDF07EFC6 (Backup 3)
When UX isn't a priority, you can create your own custom functions
and add them to your .bashrc
or .profile
:
tmback() {
tmutil destinationinfo | awk '/^ID/ {print $NF}' |
while read -r id
do
sudo tmutil startbackup -br -d "$id"
done
}
getlsnaps() {
tmutil listlocalsnapshotdates | grep "-"
}
rmlsnaps() {
lsnaps="$(getlsnaps)"
for i in $lsnaps
do
tmutil deletelocalsnapshots "$i"
done
}
thinlsnaps() {
calc=$(echo "5 * 10^9" | bc)
tmutil thinlocalsnapshots / "$calc" 2
}
Tip
These functions are provided as standalone scripts in
utils/
.