Last active
August 29, 2015 14:21
-
-
Save jayankandathil/0d43ef56eddec3466c35 to your computer and use it in GitHub Desktop.
Shell script to trigger AEM6 BlobGC via curl and JMX
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/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