Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

How to Automate AEM Offline Revision Cleanup

Avatar

Level 10

2/21/25

How to Automate AEM Offline Revision Cleanup

by @giuseppebag 

 

Dear AEM Community,

 

I'd like to share my recently published article exploring how to transform the critical but tedious process of AEM Offline Revision Cleanup into an automated, one-command operation.

 

Introduction

AEM's Oak repository eventually suffers from performance issues as unused data accumulates. My article presents a Bash script that transforms the tedious manual cleanup process into a single-command operation with built-in safety checks. This automation approach not only saves time but also reduces human error risk during critical maintenance operations.

 

Key Points

-  A powerful Bash script that automates AEM Offline Revision Cleanup with built-in safety checks.

-  More than just a wrapper for oak-run.jar—it includes pre-flight checks, path validation, interactive prompts, and atomic operations.

-  Features robust argument parsing, a streamlined Oak command engine, and safeguards to prevent data corruption.

-  Covers advanced customizations like monitoring, alerting, and dynamic retries for enterprise use.

-  Turns ORC from a tedious manual task into a scalable, low-risk automation advantage.

 

Full Article

Read the full article on https://medium.com/@giuseppebaglio/how-to-automate-aem-offline-revision-cleanup-f95db0729e71 to find out more, including the complete script, step-by-step implementation guide, and troubleshooting tips.

 

Q&A

Please use this thread to ask questions relating to this article

3 Comments

Avatar

Level 6

7/21/25

Helpful thanks @giuseppebag 

Avatar

Administrator

8/21/25

Thanks for sharing this, @giuseppebag. Very handy to see ORC wrapped into a safer automation flow. Quick question: have you seen teams scheduling this automation as part of routine maintenance (say weekly/monthly), or do you still recommend triggering it only when performance issues start showing?

Avatar

Level 10

9/24/25

@kautuk_sahni ORC should be used only in exceptional cases (such as when online cleanup is insufficient to reclaim space, before a storage format migration, or when advised by Adobe Customer Care) because it requires stopping AEM and taking exclusive control of the repository.

ORC typically reclaims more space than online cleanup, but the trade‑off is an operational impact and required downtime, so it should be driven by observed repository growth or compaction efficacy rather than a fixed calendar.