Home  >  Article  >  Backend Development  >  centos - Linux crontab, what is the difference between executing .sh files and .php files

centos - Linux crontab, what is the difference between executing .sh files and .php files

WBOY
WBOYOriginal
2016-08-04 09:20:471063browse

Like the title, I saw a .sh file was executed in the crontab of a project, and then I searched for the corresponding php file in .sh. It feels a bit redundant. Is that so?
It can’t be a problem that affects performance

Reply content:

Like the title, I saw a .sh file was executed in the crontab of a project, and then I searched for the corresponding php file in .sh. It feels a bit redundant. Is that so?
It can’t be a problem that affects performance

They are completely different things. .sh is a shell command
.php is a PHP file

You execute the php file in the shell command. If it is very simple to execute, you might as well use php -f xxx.php
If you need to judge. Assign value. Cycle. . Of course you have to use the shell to execute it.

A .sh file can execute multiple php files according to their functions to facilitate maintenance and management.

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