Skip to content

Instantly share code, notes, and snippets.

  1. Download https://files.acrobat.com/a/preview/e885654b-8424-4698-b5e9-7751b647276b (or build oak-run 1.1.x version)
  2. Stop all AEM instances
  3. Upload the oak-run 1.1 version to the AEM server if using TarMK or MongoDB server (if using MongoMK)
  4. Run this command to start the oak console
  • on TarMK:
   java -jar target/oak-run.jar console --quiet /path/to/segmentstore
  • For MongoMK run this:
@andrewmkhoury
andrewmkhoury / readme.md
Last active April 29, 2021 08:21
How to clean up unreferenced checkpoints in Oak 1.0.x

Clean up unreferenced checkpoints

  1. Download or build oak-run 1.x matching the version you have installed in your Oak environment.
  2. Stop all AEM instances
  3. Upload the oak-run to the AEM server if using TarMK or MongoDB server (if using MongoMK)
  4. Run this command to cleanup unreferenced checkpoints on TarMK:
java -Xmx4096m -jar /apps/staging/oak-run-1.*.jar checkpoints crx-quickstart/repository/segmentstore rm-unreferenced

Clean up unreferenced checkpoints on MongoMK:

@andrewmkhoury
andrewmkhoury / oakTreeNodeCount.groovy
Last active April 29, 2021 08:21
Counting nodes in a tree of Oak repository using the oak-run console tool
import org.apache.jackrabbit.oak.spi.state.NodeState
import java.util.concurrent.atomic.AtomicInteger
def countNodes(NodeState n, String path = "/", flush = 5000, AtomicInteger count = new AtomicInteger(0), root = true) {
if(root) {
println "Counting nodes in tree ${path}"
}
cnt = count.incrementAndGet()
if (cnt % flush == 0) println(" " + cnt)