How to: Delete Time Machine Backups

0
4

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.

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.

READ :  BEST GUIDE: How to Root Your Samsung Galaxy Note 5 (5.1.1)

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


Source: https://appuals.com/

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.