How do I define jobs? Can they be written in any language? I didn't see anything in the documentation.
For example:
POST /scripts --data 'node /home/node/myJob.js'
That returns a script id { "script_id": "507f1f77bcf86cd799439011" }Then:
POST /jobs --data '{
"name":"cron_job",
"schedule":"@every 2s",
"script": "507f1f77bcf86cd799439011",
"owner":"foo",
"owner_email":"foo@bar.com"
}'
This way you don't have to manage/create the scripts on each node manually.But I think this also means you have to copy every job executable to every server that might have a chance of running the job.
[0] https://github.com/victorcoder/dcron/blob/master/job.json
The "command" field is the most important part. What you put there gets executed like this by their agent (on Linux): /bin/sh -c <your_scheduled_command_name>