Skip to content

Instantly share code, notes, and snippets.

@vi7
Created May 12, 2021 10:58
Show Gist options
  • Save vi7/8b040c09433d471e63996bc5ad28b93e to your computer and use it in GitHub Desktop.
Save vi7/8b040c09433d471e63996bc5ad28b93e to your computer and use it in GitHub Desktop.
Cronjob for the Gradle Daemon logs cleanup
# Cleanup Gradle Daemon logs older than 3hr (180min)
# NOTE: Change path to the .gradle/daemon as needed
05 */1 * * * root /usr/bin/find /var/lib/jenkins/.gradle/daemon/ -type f -mmin +180 -exec rm -vf '{}' \;
# Cleanup Gradle Daemon empty dirs
# NOTE: Change path to the .gradle/daemon as needed
10 */1 * * * root /usr/bin/find /var/lib/jenkins/.gradle/daemon/ -type d -empty -exec rm -vrf '{}' \; || true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment