如何在cakephp 3.0中运行文件shell作为服务器Docker的cron作业?
问题描述:
I have a issue and need to someone help me. I'm deploying a application use framwork CakePHP 3.0. I created shell file in folder src/Shell. I used server Docker with mysql and fpm and nginx. My local is Linux Ubuntu 12.04 Now i want to run this file as cron job. But i didn' find any document about that. I hope someone will help me. Thank you so much.
我有一个问题,需要有人帮助我。 我正在部署应用程序使用框架CakePHP 3.0。 我在文件夹src / Shell中创建了shell文件。 我使用了带有mysql和fpm和nginx的服务器Docker。 我的本地是Linux Ubuntu 12.04 我想将此文件作为cron作业运行。 但我没有找到任何关于此的文件。 我希望有人会帮助我。 非常感谢你。 p> div>
答
Out of Docker, in your PC:
1: sudo crontab-e
2: 5 4 * * * docker exec -i YOUR_PHP_CONTAINER /src/YOUR_PATH_PROJECT/bin/cake yourShellFile yourMethod