Home  >  Article  >  Backend Development  >  How to share linux scheduled tasks to run php files_PHP tutorial

How to share linux scheduled tasks to run php files_PHP tutorial

WBOY
WBOYOriginal
2016-07-20 11:14:38828browse

Script to create scheduled tasks:

dos2unix /path/to/<span filename.php 
crontab </span>-<span e 
</span><span 10</span> <span 6</span> * * * /path/to/filename.php
# chomod +x /path/to/filename.php

<span #</span><span !/usr/bin/php -q </span>
<?<span php
</span><span //</span><span 写入文件到日志log中</span>
<span file_put_contents</span>('/path/to/log', <span date</span>('Y-m-d H:i:s')."\n",<span FILE_APPEND); 
</span><span //</span><span by www.jbxue.com</span>
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/440271.htmlTechArticleScript to create scheduled tasks: dos2unix /path/to/ - * * * /path/to/filename.php # chomod +x /path/to/filename.php ? ('/path/to/log', ('Y-m-d H:i:s')."n", ?...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn