How to create "Compact blob store" Task with API

I would like to automate creating and execute Compact blob store task but I can’t find option to do with it with API scripts. I can run and stop task but cannot create it. By default I do not have Compact blob store task to hard delete deleted files from blobs.

One way would be to check .properties files if there is any “deleted=true” and delete all those files, but I think it would be better if Nexus do as it should.

Is there some other way to create scheduled-task from scripts?

Thanks!

This script find if there are “soft deleted” files on in blobs and remove them:

bdir=nexus/nexus-cache/blobs/default/content
[ -d $bdir ] && for bf in $(find $bdir | grep properties | sed “s/.properties//”); do grep -q “deleted=true” ${bf}.properties && rm -f ${bf}.properties ${bf}.bytes; done