Home > Article > Backend Development > centos - Linux crontab, what is the difference between executing .sh files and .php files
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
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.