Scheduled tasks

It is possible to create a script that insert data in a database table every day at noon?

Hey Luis. DreamFactory doesn’t have any built in scheduling tools.

However, what I’ve seen other people do is use cron (or task scheduler in windows) to run a shell script at periodic intervals that calls the API you want to use.

#!/bin/bash curl -i -k -3 -X POST http://myapi.local/api/v2/db/_table/todo -H "X-DreamFactory-API-Key: myAPIkey" -H "Content-Type: application/json" -d '{"resource":[{"name":"Post data to Todo","complete":false}]}'

This bash script would post a record to my todo table on my service db. I could then use cron to schedule the script to be run at any interval.

1 Like

It would be great that DF included scheduled tasks (perhaps via auto-requests) out of the box!

Hello,
my environment is :
DreamFactory 2.6.0
Laravel Framework 5.4.19

can I use Laravel Task Schedules (https://laravel.com/docs/5.4/scheduling#defining-schedules) for create schedules for dreamfactory? I used callback function in scheduler with DreamFactory\Core\Script\Components\BaseEngineAdapter::inlineRequest() for working with other dreamfactory services. Is it ok using laravel schedule mechanism or it can be not working in next dreamfactory builds?