diff options
author | EuAndreh <eu@euandre.org> | 2018-07-25 11:28:34 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2018-07-25 11:28:34 -0300 |
commit | fcf469b3bcb53892aebab8dd257733ccf121e2a7 (patch) | |
tree | 4b68a9169c03c8add47f8ad6870ad86158bffede /scripts | |
parent | Rename mrconfig repos to euandreh (diff) | |
download | dotfiles-fcf469b3bcb53892aebab8dd257733ccf121e2a7.tar.gz dotfiles-fcf469b3bcb53892aebab8dd257733ccf121e2a7.tar.xz |
Add status report for gc.sh
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/gc.sh | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/scripts/gc.sh b/scripts/gc.sh index 9ca5af3..3450be4 100755 --- a/scripts/gc.sh +++ b/scripts/gc.sh @@ -1,6 +1,11 @@ #!/usr/bin/env bash -## Cleaning up the NixOS store +disk_space() { + ,u | awk '{print $5" "$6}' +} + +before=$(disk_space) +yellow "Cleaning up the NixOS store" profiles=(per-user/root/channels per-user/andreh/profile per-user/andreh/channels system) @@ -14,14 +19,14 @@ nix-store --gc nix-collect-garbage -d -## Cleanup up the Trash and /tmp folders +yellow "Cleaning up up the Trash and /tmp folders" rm -rf ~/.local/share/Trash/files/* # https://askubuntu.com/a/609396 sudo find /tmp -type f -atime +10 -delete -## Erasing docker images +yellow "Erasing docker images" echo y | docker system prune -a docker rmi $(docker images -a -q) @@ -31,3 +36,10 @@ docker stop $(docker ps -a -q) docker rm $(docker ps -a -q) echo y | docker volume prune + +after=$(disk_space) + +green "Done." +green "Disk space before and after:" +blue " before: ${before}" +blue " after: ${after}" |