0
votes

I scheduled a data extraction with an Xquery query on ML 8.0.6 using the "scheduler tasks".

My Xquery query (this query works if I copy/paste it in the ML web console and I get a file available on AWS S3):

xdmp:save("s3://XX.csv",let $nl := "
"

return
document {

for $book in collection("books")/books
return (root($book)/bookId||","||
        $optin/updatedDate||$nl
)
})

My scheduled task :

  • Task enabled : yes
  • Task path : /home/bob/extraction.xqy
  • task root : /
  • task type: hourly
  • task period : 1
  • task start time: 8 past the hour
  • task database : mydatabase
  • task modules : file system
  • task user : admin
  • task host: XX
  • task priority : higher

Unfortunately, my script is not executed because no file is generated on AWS S3 (the storage used)and I do not have any logs.

Any idea to : 1/debug a job in the scheduler task? 2/ See the job running at the expected time ?

Thanks, Romain.

1

1 Answers

3
votes

First, I would try take a look at the ErrorLog.txt because it will probably show you where to look for the problem.

xdmp:filesystem-file(concat(xdmp:data-directory(),"/","Logs","/","ErrorLog.txt"))
  • Where is the script located logically: Has it been uploaded to the content database, modules database, or ./MarkLogic/Modules directory?
  • If this is a cluster, have you specified which host it's running on? If so, and using the filesystem modules, then ensure the script exists in the ./MarkLogic/Modules directory of the specified host. Inf not, and using the filesystem modules, then ensure the script exists in the ./MarkLogic/Modules directory of all the hosts of the cluster.

As for seeing the job running, you can check the http://servername:8002/dashboard/ and take a look at the Query Execution tab see the running processes, or you can get a snapshot of the process by taking a look at the Status page of the task server (Configure > Groups > [group name] > Task Server: Status and click show more button)