From fcf469b3bcb53892aebab8dd257733ccf121e2a7 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 25 Jul 2018 11:28:34 -0300 Subject: Add status report for gc.sh --- scripts/gc.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'scripts') 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}" -- cgit v1.2.3