Created
March 2, 2020 15:28
-
-
Save gangelo/f9e03e7d6526954b71e1bb49156b314d to your computer and use it in GitHub Desktop.
Bash script to delete local Time Machine snapshots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for d in $( tmutil listlocalsnapshots / ) | |
do | |
if [[ $d =~ ^.+([0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6})$ ]]; then | |
date=${BASH_REMATCH[1]} | |
echo "Running tmutil deletelocalsnapshots $date..." | |
( tmutil deletelocalsnapshots $date ) | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment