Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Shell script to trigger AEM6 BlobGC via curl and JMX
# 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
# TCP port CQ listens on
# CQ Admin user ID
# CQ Admin user password
DATE_TIME=$(date "+%Y.%m.%d-%H.%M.%S")
# rsync log file
# ------------------------------------------------
# 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