From ac6eccff3e414bf096314147ffcb8a7cefd72a19 Mon Sep 17 00:00:00 2001 From: AstroOrbis Date: Mon, 26 Jul 2021 23:54:41 +0000 Subject: [PATCH 1/9] Added Cacher log cleanup --- README.md | 2 ++ mac-cleanup | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index ad3181a..205ab05 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ A cleanup script for macOS that runs the following tasks: * Remove Lunar Client logs and cache * Remove Wget logs and hosts * Clear Bash/ZSH history +* Removes Cacher logs + ## Install Automatically diff --git a/mac-cleanup b/mac-cleanup index e06adbd..532f5f6 100755 --- a/mac-cleanup +++ b/mac-cleanup @@ -238,6 +238,14 @@ msg 'Clearing Bash/ZSH history...' rm -fv ~/.bash_history &>/dev/null rm -fv ~/.zhistory &>/dev/null +# Deletes Cacher logs +# idk either +# -Astro +if [ -d ~/cacher ]; then + msg 'Deleting Cacher logs...' + rm -rfv ~/.cacher/logs +fi + if type "brew" &>/dev/null; then if [ "$update" = true ]; then msg 'Updating Homebrew Recipes...' From 62d7db24744abcf84b14989ae341ef4846dd096c Mon Sep 17 00:00:00 2001 From: AstroOrbis Date: Tue, 27 Jul 2021 00:03:53 +0000 Subject: [PATCH 2/9] Added Android Cache and other cache deletion (for context, I randomly found a cache folder on my computer with some brew formulae cache inside) --- README.md | 1 + mac-cleanup | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 205ab05..ae53d8b 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ A cleanup script for macOS that runs the following tasks: * Remove Wget logs and hosts * Clear Bash/ZSH history * Removes Cacher logs +* Deletes Android caches ## Install Automatically diff --git a/mac-cleanup b/mac-cleanup index 532f5f6..3145e28 100755 --- a/mac-cleanup +++ b/mac-cleanup @@ -239,13 +239,27 @@ rm -fv ~/.bash_history &>/dev/null rm -fv ~/.zhistory &>/dev/null # Deletes Cacher logs -# idk either +# I dunno either # -Astro -if [ -d ~/cacher ]; then +if [ -d ~/.cacher ]; then msg 'Deleting Cacher logs...' rm -rfv ~/.cacher/logs fi +# Deletes Android (studio?) cache +# -Astro +if [ -d ~/.android ]; then + msg 'Deleting Android cache...' + rm -rfv ~/.android/cache +fi + +# Deletes other caches if they exist +# -Astro +if [ -d ~/.cache ]; then + msg 'Deleting other caches...' + rm -rfv ~/.cache/* +fi + if type "brew" &>/dev/null; then if [ "$update" = true ]; then msg 'Updating Homebrew Recipes...' From a18fe0ab93e9a85429ff53697f6a71a023176985 Mon Sep 17 00:00:00 2001 From: AstroOrbis Date: Tue, 27 Jul 2021 00:19:45 +0000 Subject: [PATCH 3/9] Added Gradle cache clearing --- README.md | 1 + mac-cleanup | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index ae53d8b..08d69e1 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ A cleanup script for macOS that runs the following tasks: * Clear Bash/ZSH history * Removes Cacher logs * Deletes Android caches +* Clears Gradle caches ## Install Automatically diff --git a/mac-cleanup b/mac-cleanup index 3145e28..0bf02c7 100755 --- a/mac-cleanup +++ b/mac-cleanup @@ -253,6 +253,13 @@ if [ -d ~/.android ]; then rm -rfv ~/.android/cache fi +# Clears Gradle caches +# -Astro +if [ -d ~/.gradle ]; then + msg 'Clearing Gradle caches...' + rm -rfv ~/.gradle/caches +fi + # Deletes other caches if they exist # -Astro if [ -d ~/.cache ]; then From 773124b72be98fc19763c0c94ad22fe1a7bd78a1 Mon Sep 17 00:00:00 2001 From: AstroOrbis Date: Tue, 27 Jul 2021 00:28:33 +0000 Subject: [PATCH 4/9] Deletes Kite logs --- README.md | 1 + mac-cleanup | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 08d69e1..6299a04 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ A cleanup script for macOS that runs the following tasks: * Removes Cacher logs * Deletes Android caches * Clears Gradle caches +* Deletes Kite logs ## Install Automatically diff --git a/mac-cleanup b/mac-cleanup index 0bf02c7..c7b9162 100755 --- a/mac-cleanup +++ b/mac-cleanup @@ -260,6 +260,13 @@ if [ -d ~/.gradle ]; then rm -rfv ~/.gradle/caches fi +# Deletes Kite Autocomplete logs +# -Astro +if [ -d ~/.kite ]; then + msg 'Deleting Kite logs...' + rm -rfv ~/.kite/logs +fi + # Deletes other caches if they exist # -Astro if [ -d ~/.cache ]; then From 41021b7940d6000e4b9bacc33943f52325d8e9c5 Mon Sep 17 00:00:00 2001 From: AstroOrbis Date: Wed, 28 Jul 2021 16:43:28 +0000 Subject: [PATCH 5/9] Added more log and cache cleanup options --- mac-cleanup | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mac-cleanup b/mac-cleanup index c7b9162..1a37573 100755 --- a/mac-cleanup +++ b/mac-cleanup @@ -118,11 +118,14 @@ msg 'Clearing System Cache Files...' sudo rm -rfv /Library/Caches/* &>/dev/null sudo rm -rfv /System/Library/Caches/* &>/dev/null sudo rm -rfv ~/Library/Caches/* &>/dev/null +sudo rm -rfv /private/var/folders/bh/5qn6f27x049drtr8rqq75jt80000gp/C/*/* &>/dev/null msg 'Clearing System Log Files...' sudo rm -rfv /private/var/log/asl/*.asl &>/dev/null sudo rm -rfv /Library/Logs/DiagnosticReports/* &>/dev/null +sudo rm -rfv /Library/Logs/CreativeCloud/* &>/dev/null sudo rm -rfv /Library/Logs/Adobe/* &>/dev/null +sudo rm -fv /Library/Logs/adobegc.log &>/dev/null rm -rfv ~/Library/Containers/com.apple.mail/Data/Library/Logs/Mail/* &>/dev/null rm -rfv ~/Library/Logs/CoreSimulator/* &>/dev/null From 6a8d14cddda29b2c760e610552f0d2990c8cbf2f Mon Sep 17 00:00:00 2001 From: AstroOrbis Date: Wed, 28 Jul 2021 17:20:14 +0000 Subject: [PATCH 6/9] :x: legacy -n flag from README (mac-cleanup59) --- .gitignore | 3 ++- README.md | 7 ------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 311f121..297321d 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,5 @@ Temporary Items .apdisk .env -.idea \ No newline at end of file +.idea +.vscode \ No newline at end of file diff --git a/README.md b/README.md index 6299a04..1fdefd4 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,6 @@ A cleanup script for macOS that runs the following tasks: * Clears Gradle caches * Deletes Kite logs - ## Install Automatically ### Using homebrew @@ -92,12 +91,6 @@ FLAGS: -n no brew updates ``` -Clean up without homebrew updates: - -``` -$ mac-cleanup -n -``` - ## Contributors ### Code Contributors From 251e72f8b13bcf3a63cd6905f49100ae92ec8855 Mon Sep 17 00:00:00 2001 From: AstroOrbis Date: Wed, 28 Jul 2021 13:33:18 -0400 Subject: [PATCH 7/9] Quickfix Explanation: The file structure is "/private/var/folders/bh/RandomFolderName/Letter/Folders" So here, I'm deleting the contents of every sub-folder. --- mac-cleanup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mac-cleanup b/mac-cleanup index 1a37573..028360f 100755 --- a/mac-cleanup +++ b/mac-cleanup @@ -118,7 +118,7 @@ msg 'Clearing System Cache Files...' sudo rm -rfv /Library/Caches/* &>/dev/null sudo rm -rfv /System/Library/Caches/* &>/dev/null sudo rm -rfv ~/Library/Caches/* &>/dev/null -sudo rm -rfv /private/var/folders/bh/5qn6f27x049drtr8rqq75jt80000gp/C/*/* &>/dev/null +sudo rm -rfv /private/var/folders/bh/*/*/*/* &>/dev/null msg 'Clearing System Log Files...' sudo rm -rfv /private/var/log/asl/*.asl &>/dev/null From 561f613c7ce785d07dbd70ade6e80dc8f69cf6ef Mon Sep 17 00:00:00 2001 From: AstroOrbis Date: Wed, 28 Jul 2021 11:40:22 -0700 Subject: [PATCH 8/9] Update mac-cleanup --- mac-cleanup | 7 ------- 1 file changed, 7 deletions(-) diff --git a/mac-cleanup b/mac-cleanup index 028360f..5411cc4 100755 --- a/mac-cleanup +++ b/mac-cleanup @@ -270,13 +270,6 @@ if [ -d ~/.kite ]; then rm -rfv ~/.kite/logs fi -# Deletes other caches if they exist -# -Astro -if [ -d ~/.cache ]; then - msg 'Deleting other caches...' - rm -rfv ~/.cache/* -fi - if type "brew" &>/dev/null; then if [ "$update" = true ]; then msg 'Updating Homebrew Recipes...' From 90c1805127afc4f6d8ca07bc2dded6ced2ab7603 Mon Sep 17 00:00:00 2001 From: AstroOrbis Date: Wed, 28 Jul 2021 11:40:29 -0700 Subject: [PATCH 9/9] Create mac-cleanup