Esri/geoportal-server-harvester

Daily schedule - setting the time

Closed this issue · 4 comments

We have an option for a daily task, however theres no info on what time this takes place.
I would like to be able to set the exact time of the daily task. Is there a way to go about doing this?

I see that this can be done through REST. But not really sure where to start. An example would be great.

I tried POSTing to the endpoint using Postman:
http://calwgist08:8080/geoharvest/rest/harvester/tasks/cf144d6a-05a2-450d-a9d0-e985ba1571bc/schedule

{"uuid":"57d0e78f-4b10-4087-89e3-eaaabf6032ab","taskId":"cf144d6a-05a2-450d-a9d0-e985ba1571bc","triggerDefinition":{"type":"PERIOD","taskDefinition":{"processor":null,"source":{"type":"UNC","label":"GOM","properties":{"unc-root-folder":"C:\\Harvest","unc-pattern":""},"keywords":[]},"destinations":[{"action":{"type":"FOLDER","label":"xmls","properties":{"folder-root-folder":"c:\\harvest","folder-cleanup":"false"},"keywords":[]},"drains":null}],"keywords":[],"incremental":false,"ignoreRobotsTxt":false},"properties":{"t-period":"R/20170726T02/P1D"},"keywords":[]}}

I get this error:
26-Jul-2017 16:36:16.645 SEVERE [http-apr-8080-exec-8] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [spring] in context with path [/geoharvest] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause java.lang.NullPointerException at com.esri.geoportal.harvester.engine.defaults.DefaultTriggersService.schedule(DefaultTriggersService.java:177) at com.esri.geoportal.harvester.rest.TaskController.scheduleTask(TaskController.java:434)

Any clues on how this works? Thanks

If you are interested only in harvesting daily (not weekly, monthly, etc.) then why not to choose to "harvest at"? It allows to exactly what you need: harvesting at the particular hour every day.