Created
March 6, 2019 13:25
-
-
Save darren/b708253bb1b0ab603fa00ec942e641b1 to your computer and use it in GitHub Desktop.
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
function tmc() { | |
before=$(df -hl / |awk '{print $3}' |tail -n1) | |
count=0 | |
for snapshot in $(tmutil listlocalsnapshots /|awk -F. '{print $4}');do | |
let 'count++' | |
echo "delete snapshot $snapshot" | |
tmutil deletelocalsnapshots $snapshot; | |
done | |
after=$(df -hl / |awk '{print $3}' |tail -n1) | |
if [[ $count -ne 0 ]]; then | |
echo "Total $count snapshot(s) deleted, Size change: $before ===> $after" | |
else | |
echo "No snapshot deleted" | |
fi | |
} | |
function tml() { | |
tmutil listlocalsnapshots /|awk -F. '{print $4}' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment