Skip to content

Instantly share code, notes, and snippets.

@herisulistiyanto
Created September 13, 2022 10:16
Show Gist options
  • Save herisulistiyanto/412d4f19e5f09a3c8cea55f505e84d6a to your computer and use it in GitHub Desktop.
Save herisulistiyanto/412d4f19e5f09a3c8cea55f505e84d6a to your computer and use it in GitHub Desktop.
Gradle Daemon Log Housekeeping
#!/bin/sh
# This script is used to clean up the log files in the Gradle Daemon directory.
# All of the *.out.log files will be removed
# Use it if you have storage space issue, caused of gradle daemon log
GRADLE_HOME=$HOME/.gradle
GRADLE_DAEMON_DIR=$GRADLE_HOME/daemon
if [ -d "$GRADLE_HOME" ]; then
if [ -d "$GRADLE_DAEMON_DIR" ]; then
find "$GRADLE_DAEMON_DIR" -type f -name "*.out.log" -exec rm -f {} \;
echo "Done Removing Gradle Daemon Log Files"
else
echo "$GRADLE_DAEMON_DIR does not exist"
fi
else
echo "$GRADLE_HOME does not exist"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment