Created
March 2, 2021 17:37
-
-
Save MightyPork/c510ddb7f9ee9cf1ac6c713cdb350dfa to your computer and use it in GitHub Desktop.
Run "cargo sweep" in all direct subfolders and report disk space saved
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
#!/bin/bash | |
before=$(du -bs | cut -d$'\t' -f1) | |
for d in $(ls -1); do | |
if [[ -e "$d/target" ]]; then | |
echo "------------ $d -------------" | |
cd "$d" | |
cargo sweep -i | |
cd .. | |
fi | |
done | |
after=$(du -bs | cut -d$'\t' -f1) | |
echo "Sweep done, before $before, after $after" | |
saved=$(echo "($before - $after)/1048576" | bc) | |
echo "Saved $saved MB" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment