Automatically execute php files under Linux

how to execute php files automatically in Linux environment?

Mar.11,2021

execute php crontab


Baidu has a look at the Linux system to plan tasks, and then follow the above to make a planned task, then you can execute the task regularly


crontab

such as

* * * * * /usr/local/php/bin/php   /data/1.php

just use crontab. This is a scheduled task service under the linux system. In the crontab file created by users
, each line represents a task, and each field of each line represents a setting. Its format is divided into six fields. The first five paragraphs are the time setting section, and the sixth paragraph is the command segment to be executed. The format is as follows:
minute hour day month week command
where:
minute: represents minutes. Can be any integer from 0 to 59.
hour: represents hours, which can be any integer from 0 to 23.
day: represents the date and can be any integer from 1 to 31.
month: represents the month and can be any integer from 1 to 12.
week: represents the day of the week, which can be any integer from 0 to 7, where 0 or 7 represents Sunday.
the command to be executed by command: can be either a system command or a script file written by yourself.

gives you a very good reference for study:
http://www.cnblogs.com/peida/.

Menu