美文网首页
crontab定时执行PHP脚本

crontab定时执行PHP脚本

作者: 我在太行山下 | 来源:发表于2016-08-05 16:23 被阅读0次

1.脚本要有执行权限。

2.bash环境变量和crontab环境变量不一致问题,需要引入bashrc

3.crontab -e 命令用于编辑定时执行命令

  crontab -l 命令用于显示当前crontab命令

4.配置完无需重启crond即可生效。

配置事例如下:

*/1 * * * * source ~/.bashrc && cd /home/hdp-btime/renzhidong && php hdfs.php

Minute Hour Day Month Dayofweek  command

相关文章

网友评论

      本文标题:crontab定时执行PHP脚本

      本文链接:https://www.haomeiwen.com/subject/yinhsttx.html