Created
August 10, 2022 21:36
-
-
Save singularitti/7a9f52befafb3733154d08836f151fe0 to your computer and use it in GitHub Desktop.
Delete local time machine backups #macOS #backup
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
using IOCapture | |
c = IOCapture.capture() do | |
run(`tmutil listlocalsnapshots /`) | |
end | |
const REGEX = r"com\.apple\.TimeMachine\.(\d+-\d+-\d+-\d+)\.local" | |
map(split(c.output, "\n", keepempty=false)) do line | |
m = match(REGEX, line) | |
if m !== nothing | |
version = m[1] | |
try | |
run(`tmutil deletelocalsnapshots $version`) | |
catch e | |
e | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment