Automation of data store garbage collection | Community
Skip to main content
Level 2
August 19, 2016

Automation of data store garbage collection

  • August 19, 2016
  • 2 replies
  • 7080 views

Hi All,

I'm trying to automate the data store garbage collection through the curl command given in below link :

https://docs.adobe.com/docs/en/aem/6-0/administer/operations/data-store-garbage-collection.html

Curl command: 

     
1
curl -u admin:xyz -X POST --data markOnly=false http://localhost:4502/system/console/jmx/org.apache.jackrabbit.oak%3Aid%3D14%2Cname%3D%22repository+manager%22%2Ctype%3D%22RepositoryManagement%22/op/startDataStoreGC/boolean
 

But not able to get the correct response. When we hit the URL given in the curl command it is giving us the 404 error message as it is unable to find the operations "runDataStoreGarbageCollection". When I hit the url without the operations (shared below), it is able to find  but unable to open the operation as it is opened as a pop-up. Please advise on how to automate data store garbage collection.

curl -u admin:admin -X POST http://localhost:4502/system/console/jmx/com.adobe.granite:type=Repository

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

antoniom5495929
Level 7
August 19, 2016

If you try to open the url from the system console, you have a 404?

something like: system/console/jmx/org.apache.jackrabbit.oak%3Aid%3D14%2Cname%3D%22repository+manager%22%2Ctype%3D%22RepositoryManagement%22

Swathi1Author
Level 2
August 19, 2016

Hi,

Without /op/startDataStoreGC/boolean in the URL, I'm able to open jmx console. But with /op/... I'm getting 404. Please see the attachment.

Swathi1Author
Level 2
August 25, 2016

Hi Swathi,

I just installed a 6.1 instance with a DS and got the following command to work:

curl -u admin:admin -X POST --data 'markOnly=true' http://localhost:4502/system/console/jmx/org.apache.jackrabbit.oak%3Aid%3D15%2Cname%3D%22repository+manager%22%2Ctype%3D%22RepositoryManagement%22/op/startDataStoreGC/boolean'

In order to get the correct command, you can use chrome tools to look at the request, one developer tools, then in the main window click on startDataStoreGC, then click on the network tab and then find the request, you can then right click and select Copy as curl, as in the screenshot. Then use the command captured to build the above command. 

Regards,

Opkar


Hi Opkar,

Thank you very much for your reply. As you suggested, we were able to copy the command as CURL from developer tools by invoking garbage collection manually. You mentioned that we would be able to track this activity from logs. We see following message from our request.log file. Were you referring to this? Is there any other way or other parameters that we can use to verify if GC is going well or the the status of GC

25/Aug/2016:11:33:52 -0400 [1373283] -> POST /system/console/jmx/org.apache.jackrabbit.oak%3Aid%3D16%2Cname%3D%22repository+manager%22%2Ctype%3D%22RepositoryManagement%22/op/startDataStoreGC/boolean HTTP/1.1
joerghoh
Adobe Employee
Adobe Employee
August 25, 2016

Make sure you get the quoting right, otherwise the Shell interprets characters like "&".

Jörg