Blog

Why Time Machine Backups Failed After Upgrading to APFS and the Snapshot Pruning Script That Made It Work Again

Mac users love the simplicity and reliability of Time Machine, Apple’s built-in backup solution. However, for many users, the smooth sailing came to a sudden halt after upgrading their systems to macOS High Sierra and beyond—especially due to the shift from HFS+ to the modern Apple File System (APFS). What appeared to be a behind-the-scenes file system upgrade wreaked havoc on Time Machine backups, leaving many users puzzled as to why regular backups began to fail. This article dives into the cause of the issue, how APFS snapshots played a surprising role, and how a community-created pruning script resurrected Time Machine’s functionality.

TL;DR

After upgrading to APFS, many Mac users experienced Time Machine failures due to an issue with unpruned volume snapshots filling up disk space. APFS introduced a new snapshot mechanism that Time Machine uses, but it failed to reliably clean up old snapshots. This left drives full, making backups impossible. A pruning script that manually deletes old snapshots fixed the issue and allowed backups to resume.

The Shift to APFS and Its Impact on Time Machine

Apple introduced the Apple File System (APFS) with macOS High Sierra, bringing faster performance, better encryption, and snapshot support to the Mac lineup. For most users, the transition from HFS+ to APFS went unnoticed. However, under the hood, this new file system dramatically changed how data was managed—and it introduced a key feature that would become both a blessing and a curse for Time Machine: snapshots.

APFS snapshots are point-in-time representations of the file system, allowing system states to be restored without needing to copy actual files. They are space-efficient and fast. Time Machine started using these snapshots for local backups before copying them to an external drive. That’s where the problems began.

What Went Wrong?

While snapshots themselves are incredibly helpful, APFS did not reliably clean them up, especially when Time Machine backups failed to complete. Every time a backup was attempted, a snapshot would be created—and if the backup did not finish for any reason (disconnection, sleep mode, drive ejection), that snapshot stuck around, consuming disk space.

Over time, users saw noticeable slowdowns and received messages like “Time Machine couldn’t complete the backup because there isn’t enough space on the backup disk.” Even stranger, some users noticed that reducing the number of files in their system did not free up space—the “Other” storage category stubbornly stayed large.

Key Problems That Emerged:

  • Time Machine Backups Failed: Local snapshots filled the disk, with no cleanup mechanism kicking in.
  • Low Free Space Notifications: Despite deleting files, space wasn’t reclaimed.
  • No Clear Error Message: Users weren’t informed about lingering snapshots causing the problem.

Explaining APFS Snapshots in More Detail

Snapshots are stored on the same volume as your system, and they can’t be seen from Finder. You can list them using the tmutil listlocalsnapshots / command in Terminal. If you have dozens—or even hundreds—of them, you’ve likely run into the Time Machine snapshot overflow syndrome.

Snapshots are supposed to be temporary, deleted within 24 hours or after a successful backup. But bugs in macOS or power interruptions often freeze them in place.

Crucially, older versions of macOS didn’t give users control over snapshot pruning. So unless you were a power user and knew how to use Terminal commands, you were stuck.

The Solution: Pruning Snapshots Manually

Frustrated Mac users, system admins, and developers began experimenting with command-line tools to delete these errant snapshots. One particularly helpful method was using the command:

sudo tmutil deletelocalsnapshots YYYY-MM-DD-HHMMSS

While effective, deleting each snapshot manually proved tedious—especially for users with dozens or hundreds of them. The community needed a better solution. That’s when a simple but effective bash script started making rounds in forums and Git repositories.

The Snapshot Pruning Script That Fixed Everything

The script was clean, minimal, and did one job: it listed all snapshots and deleted them, optionally preserving recent ones. Below is a simplified version of how the script worked:


#!/bin/bash
echo "Pruning Time Machine snapshots..."
snapshots=$(tmutil listlocalsnapshots / | grep com.apple.TimeMachine)
for snapshot in $snapshots; do
  date=$(echo $snapshot | cut -d'.' -f4)
  echo "Deleting snapshot $date"
  sudo tmutil deletelocalsnapshots $date
done
echo "Done. All outdated snapshots removed."

Users could schedule this script via cron or launchd to run hourly or daily. It cleared old snapshots, restored disk space, and allowed Time Machine to properly create new backups.

Benefits of the Pruning Script:

  • Automated Cleanup: No more manual deleting every snapshot one by one
  • Restored Time Machine Functionality: Backups resumed automatically after space was freed
  • No Need for Third-Party Apps: Everything ran within macOS’s built-in tools

Additional Tips to Improve Backup Reliability

If you’ve been bitten by the APFS snapshot bug, here are a few other recommendations:

  • Upgrade to the Latest macOS: Apple addressed many APFS snapshot bugs in subsequent updates.
  • Use Disk Utility: Occasionally verify and repair your backup drive.
  • Keep Time Machine Drives Mounted: Prevent backups from routinely failing by ensuring the drive is connected.
  • Use External Tools: Tools like Carbon Copy Cloner offer more control over snapshot management.

Conclusion

The introduction of APFS was a leap forward for macOS—bringing modern file system capabilities to the aging HFS+ environment. But as with any major architectural change, it came with growing pains. The intersection of Time Machine and APFS snapshots caught many users off guard, filling up disks and breaking backups silently.

Fortunately, the community delivered an elegant fix with the snapshot pruning script. By routinely cleaning out old, unnecessary snapshots, users regained control over disk space and restored their backup schedules to normal. While macOS updates have improved snapshot handling over time, understanding how they work—and how to manage them—remains essential for any Mac power user.

If your Time Machine ever fails mysteriously after an upgrade, now you know exactly where to look—and what to delete!