Last active
May 23, 2018 14:53
-
-
Save gustavomdsantos/017738fe35f26e70e712bdbcee6293f5 to your computer and use it in GitHub Desktop.
Shell script to clean old dependencies from Maven repositories in Linux computers. Downloaded dependencies for more than 30 days is deleted. Code based on: http://stackoverflow.com/a/29970448
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
find ~/.m2 -atime +30 -iname '*.pom' | while read pom; do parent=`dirname "$pom"`; rm -Rf "$parent"; done; | |
find ~/.m2 -empty -type d -delete; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment