如何在Symfony2中创建一个cron任务

时间:2021-10-04 01:08:47

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 ?

我有一个小问题,如何创建一个简单的cron任务,在Symfony中调用一些服务操作,谁可以每晚自动执行?

3 个解决方案

#1


35  

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.

Symfony2不管理cron任务,仅仅因为这是系统级别。话虽这么说,您可以创建一个命令并将其注册为cron任务。

#2


4  

You can use CommandSchedulerBundle

您可以使用CommandSchedulerBundle

#3


0  

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

您现在可以使用TaskScheduleBundle在symfony中创建cron作业。

#1


35  

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.

Symfony2不管理cron任务,仅仅因为这是系统级别。话虽这么说,您可以创建一个命令并将其注册为cron任务。

#2


4  

You can use CommandSchedulerBundle

您可以使用CommandSchedulerBundle

#3


0  

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

您现在可以使用TaskScheduleBundle在symfony中创建cron作业。