ONLINE COMPACTION
Before running any compactions make sure you have a consistent backup you can easily restore to in case its needed. These features are hot off the press!
1. First, get the latest hotfix of Oak which provides you this functionality from the package share for AEM 6.0 (Oak 1.0.22), with AEM 6.1 (Oak 1.2.7) it is built in!
2. Install it (there is a restart of AEM required afterwards) don‘t restart just stop after it is finished (make sure you tail the logs!)
3. ssh into your machine and use the oak-run.jar matching your oak version to clean up old checkpoints
-> http://mvnrepository.com/artifact/org.apache.jackrabbit/oak-run
4. To clean up the checkpoints follow the steps below
java -jar oak-run.jar checkpoints install-folder/crx-quickstart/repository/segmentstore
java -jar oak-run.jar checkpoints install-folder/crx-quickstart/repository/segmentstore rm-all
5. Now start your AEM again and go to the system console -> JMX -> search for "CompactionStrategy"
6. Make sure the PausedCompaction is set to false as well as CloneBinaries
7. Go to the maintenance dashboard -> http://localhost:4502/libs/granite/operations/content/maintenance/window.html/mnt/overlay/granite/operations/config/maintenance/_granite_daily
8. On there trigger the revision cleanup and tail to logs for progress
9. The log‘s will tell you how much it cleaned up but you can allways check with -> du -h --max-depth=1 and compare before and after results of your repository folder
If your curious about more functionality (backup etc.) of the oak-run.jar have a look on the jackrabbit github -> https://github.com/apache/jackrabbit-oak/tree/trunk/oak-run