installCrontab 907 B

123456789101112131415161718192021222324252627282930
  1. #!/alidata/server/php/bin/php
  2. <?php
  3. require './common/base.php';
  4. //初始化配置参数
  5. //php命令
  6. $phpPath = \lwmf\base\Config::getInstance()->get('php', 'worker');
  7. //项目目录
  8. $projectPath = LWM_PROJECT_PATH;
  9. //进程运行角色
  10. $uid = \lwmf\base\Config::getInstance()->get('uid', 'worker');
  11. //乐外卖定制任务配置
  12. //# Example of job definition:
  13. //# .---------------- minute (0 - 59)
  14. //# | .------------- hour (0 - 23)
  15. //# | | .---------- day of month (1 - 31)
  16. //# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
  17. //# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
  18. //# | | | | |
  19. //# * * * * * user-name command to be executed
  20. $crontab =<<< EOT
  21. #每分钟上报监控数据
  22. */1 * * * * {$uid} {$phpPath} {$projectPath}/scripts/yiic statis push &>> {$projectPath}/runtime/statis_push.log
  23. EOT;
  24. //安装定时任务
  25. installCrontab();