How to: Delete Time Machine Backups

You may want to delete old time machine backups, to free up space and create new backup. You may also get this message “Time Machine could not complete the backup.” if the backups are larger and exceeds the available disk space on your mac. Whatever the reason be, in this guide i will discuss two methods which will help you delete back ups. However, i would suggest that you read the complete guide before proceeding and pick the method which best fits your skills.

Delete Time Machine Backups

Method 1: Using the  Terminal Utility

CAUTION: Only use this method if you know what you’re doing because the actions taken cannot be undone.

1. Open Applications -> Utilities -> Terminal.
2. In Terminal, type the following command and replace the path with the correct one


sudo tmutil delete /Volumes/drive_name/Backups.backupdb/old_mac_name

You can get this information from the Finder.

drive_name (is your drive name)
backups.backupdb (the back  up path)
old_mac_name (name of the back up file)

When you enter the command above, it will prompt you for your password but this will not be echoed/displayed, so simply enter the password and hit the return/enter key.

You can also use the tmutil tool if you want to delete backups 1 by 1.

sudo tmutil delete /Volumes/drive_name/Backups.backupdb/mac_name/YYYY-MM-DD-hhmmss

The tmutil will not work on any versions earlier then Lion as it was introduced with Lion.
Method 2: Via Time Machine (GUI)

So far the easiest method is to Open Time Machine and browse to the point/time you want to delete.  Choose the cog icon in the finder and hit Delete Backup. This will ensure that the data integriy stays intact.

Method 3: Via The Bash Script

Below is the script,  which will automatically locate the oldest backup on Time Machine. This will prompt you with Y input. The script needs to be copied and saved as an .sh file, when you run it you will be prompted for the administrator password to confirm deletion.

COMPUTER_NAME=$(/usr/sbin/scutil –get ComputerName)
NBACKUPS=$(/usr/bin/tmutil listbackups |
/usr/bin/grep “$COMPUTER_NAME” |
/usr/bin/wc -l)
OLDEST_BACKUP=$(/usr/bin/tmutil listbackups |
/usr/bin/grep “$COMPUTER_NAME” |
/usr/bin/head -n1)
LATEST_BACKUP=$(/usr/bin/tmutil latestbackup)
echo Latest backup: $LATEST_BACKUP
if [[ -n “$LATEST_BACKUP” && “$LATEST_BACKUP” != “$OLDEST_BACKUP” ]] then
echo -n “$NBACKUPS backups. Delete oldest: ${OLDEST_BACKUP##*/} [y/N]? ”
read answer
case $answer in
y*)
echo Running: /usr/bin/sudo /usr/bin/tmutil delete “$OLDEST_BACKUP”
/usr/bin/sudo time /usr/bin/tmutil delete “$OLDEST_BACKUP”
;;
*)
echo No change
;;
esac
else
echo “No backup available for deletion”
fi

ABOUT THE AUTHOR

Kevin Arrows


Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.
Back to top button