This file contains hidden or 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
| // This script loops though the list of collection names in a MongoDB and runs the compact operation on them | |
| // Simply paste this into the Mongo shell | |
| use testDbName; | |
| db.getCollectionNames().forEach(function (collectionName) { | |
| print('Compacting: ' + collectionName); | |
| db.runCommand({ compact: collectionName }); | |
| }); |
This file contains hidden or 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
| #!/bin/sh | |
| M2_REPO=${HOME}/.m2 | |
| OLDFILES=/tmp/deleted_artifacts.txt | |
| AGE=181 # more or less 6 months and it's a palindromic prime number, so it's cool | |
| echo "==== To be Deleted Jars ====" >> ${OLDFILES} | |
| find "${M2_REPO}" -name '*-SNAPSHOT*jar' -atime +${AGE} -exec dirname {} \; >> ${OLDFILES} | |
| echo "==== To be Deleted Wars/Ears ====" >> ${OLDFILES} |