-1

How do you schedule tasks to run in SilverStripe, for example run a task every hour? Or even access a rest api every minute.

wmk
  • 4,531
  • 1
  • 18
  • 37
SemanticUI
  • 789
  • 2
  • 7
  • 16

1 Answers1

1

There are two possibilities: Cron or... faked cron.

If you can use cron on your server directly call SilverStripe in your CLI.

//run a task "MyTask" every hour at minute 29:

//min hr day month dayofweek 
29 * * * * /your/site/folder/sake dev/tasks/MyTask

//run a task "MyTask" at 3:13 am every sunday:

29 3 * * 0 /your/site/folder/sake dev/tasks/MyTask

If you do not have access to cron for some reason, there is this SilverStripe crontask module you can use.

Community
  • 1
  • 1
wmk
  • 4,531
  • 1
  • 18
  • 37