Created
October 12, 2017 20:47
-
-
Save nblair/0a3a8ac9ebe2f1f201a4914f5a295839 to your computer and use it in GitHub Desktop.
A groovy script to check the 'freeze' state of Nexus Repository Manager databases
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
/** | |
* Tested with Nexus Repository Manager 3.6. | |
* Warning: uses internal APIs which are subject to change. | |
* | |
* When run, prints a task log entry for each OrientDB database indicating whether or not the database is frozen. | |
* See https://orientdb.com/docs/2.2/Console-Command-Freeze-Db.html | |
* | |
* Usage: | |
* 1. Create a task with the "Execute Script" type - see https://help.sonatype.com/display/NXRM3/Configuration#Configuration-ConfiguringandExecutingTasks | |
* 2. Set task frequency to manual | |
* 3. Choose groovy for language, and paste the following groovy code into the source block. | |
*/ | |
import org.sonatype.nexus.orient.DatabaseManager | |
import static org.sonatype.nexus.orient.DatabaseInstanceNames.DATABASE_NAMES | |
def manager = container.lookup(DatabaseManager.class.name) | |
DATABASE_NAMES.each { | |
log.info("${it} isFrozen=${manager.instance(it).isFrozen()}") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script fixes: https://issues.sonatype.org/browse/NEXUS-14529