Skip to content

Instantly share code, notes, and snippets.

@wildone
Forked from jayankandathil/cq_trigger_blobgc.sh
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wildone/07b502d5a4d0f57d4bd3 to your computer and use it in GitHub Desktop.
Save wildone/07b502d5a4d0f57d4bd3 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Bash script to trigger AEM 6.0 Blob GC using curl via JMX
# Author : Jayan Kandathil
# Version : 0.1
# Last updated : May 14, 2015
# Instructions : Copy to CQ/AEM Linux instance's /tmp folder, make necessary changes, enable the execute bit and run
# Echo on (for debugging purposes)
# set -x verbose
# Host that CQ runs on
HOST=localhost
# TCP port CQ listens on
PORT=4502
# CQ Admin user ID
CQ_USER=admin
# CQ Admin user password
CQ_USER_PASSWORD=admin
DATE_TIME=$(date "+%Y.%m.%d-%H.%M.%S")
# rsync log file
LOG_FILE=/tmp/trigger_blobgc.log
# ------------------------------------------------
# Do not configure below this point
# ------------------------------------------------
# Log timestamp
date | tee -a $LOG_FILE
# Initiate Blob GC using curl (MongoMK example using Document NodeStore)
curl -u $CQ_USER:$CQ_USER_PASSWORD -X POST http://$HOST:$PORT/system/console/jmx/org.apache.jackrabbit.oak%3Aid%3D7%2Cname%3D%22Document+node+store+blob+garbage+collection%22%2Ctype%3D%22BlobGarbageCollection%22/op/startBlobGC/ | tee -a $LOG_FILE
# Initiate Blob GC using curl (TarMK example using Segment NodeStore)
#curl -u $CQ_USER:$CQ_USER_PASSWORD -X POST http://$HOST:$PORT/system/console/jmx/org.apache.jackrabbit.oak%3Aid%3D3%2Cname%3D%22Segment+node+store+blob+garbage+collection%22%2Ctype%3D%22BlobGarbageCollection%22/op/startBlobGC/ | tee -a $LOG_FILE
echo "Triggered Blob GC, check error.log"
echo $'\n'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment