Hi,
Create a quartz-activated job (see scheduled-jobs-context.xml) that gets the NodeService and SearchService injected.
Search for the active documents using a Lucene query against the workspace://SpacesStore and just call delete for each match found. Remember that your search can be limited to date ranges based on the creation date. If you want to base the deletion on last-access time, then you'll need to make use of something like the ContentHitsAspect from the SDK CustomAspect sample.
Do the same against the archive://SpacesStore and delete where appropriate.
A forge project would be a good place to host the code. Alternatively, supported customers can normally get these sorts of features pushed in without too much trouble.
Regards