25

I have a little question, how create a simple cron task who call some service action in Symfony, who could be executed automatically each night ?

skrilled
  • 5,350
  • 2
  • 26
  • 48
user2178964
  • 124
  • 6
  • 16
  • 40

3 Answers3

38

Symfony2 does not manage cron tasks, simply because this is system level. That being said, you can create a command and register it as a cron task.

julesbou
  • 5,570
  • 4
  • 31
  • 36
  • 1
    Just found this thread on Google. Old, but here is a post just about this subject: https://inuits.eu/blog/creating-automated-interval-based-cron-tasks-symfony2. I found it very handy. – pusle Feb 17 '16 at 09:45
4

You can use CommandSchedulerBundle

Mohamed EL HABIB
  • 622
  • 7
  • 10
1

You can now use TaskScheduleBundle to make your cron jobs within symfony.

ancyrweb
  • 1,220
  • 12
  • 12