Skip to content

Instantly share code, notes, and snippets.

@davsclaus
Created February 23, 2017 09:08
Show Gist options
  • Save davsclaus/25a01789bb4612af676da0895c6b18ab to your computer and use it in GitHub Desktop.
Save davsclaus/25a01789bb4612af676da0895c6b18ab to your computer and use it in GitHub Desktop.
#!/bin/sh
M2_REPO=${HOME}/.m2
OLDFILES=/tmp/oldfiles.txt
AGE=31
find "${M2_REPO}" -name '*jar' -atime +${AGE} -exec dirname {} \; >> ${OLDFILES}
find "${M2_REPO}" -name '*war' -atime +${AGE} -exec dirname {} \; >> ${OLDFILES}
for x in `cat ${OLDFILES}`; do rm -rf "$x"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment