Skip to content

Instantly share code, notes, and snippets.

@oxhacks
Last active November 13, 2019 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oxhacks/d9f499e5ae52d6306eec44bed73bf841 to your computer and use it in GitHub Desktop.
Save oxhacks/d9f499e5ae52d6306eec44bed73bf841 to your computer and use it in GitHub Desktop.
# Removes local Time Machine backups
BACKUPS=$(tmutil listlocalsnapshotdates)
echo Deleting local backups...
for d in $BACKUPS; do
# The first line of the output of this command is "Snapshot dates for all disks:"
# so we're just making sure this is a number and presumably a date.
if [ ${d:0:1} == 2 ]; then
echo $d
tmutil deletelocalsnapshots $d
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment