Implementation of PHP script under Linux, Linux executes PHP script
Entering commands in Linux
Copy the Code code as follows:
Crontab-e
Then use the VIM command to edit the open file, enter
Copy the Code code as follows:
0 * * * */usr/bin/php-f/home/userxxx/update.php
Save, exit, OK, now the system will automatically execute the update.php script at each 0 point, the script can write the database execution, automatic email and other functions.
Note: Written directly to 0 * * * * php-f/home/userxxx/update.php will not work.
In addition, the cronjob format is:
MIN HOUR DOM MON DOW CMD
field |
description |
allowed Value |
min |
minute field |
0 to |
hour |
hour field |
0 to" |
dom |
day of Month |
1-31 |
mon |
month field |
1-12 |
dow |
day of Week |
0-6 (0 = Sunday) |
Cmd |
Command |
Any command to be executed. |
Use (-) to delimit range
Example: 0 0-6 * * command means 0-6-point execution command per day
Use (,) to enumerate time
such as: 0,15,30,45 * * * * command means 0 points per hour, 15 points, 45 points, 30 Chapter execution command
Use (/) to specify the interval
such as: * */4 * * * command means execute command every four hours
Combination usage
0-10/2 * * * * command means that the command is executed every 2 minutes within the first 10 minutes
http://www.bkjia.com/PHPjc/958258.html www.bkjia.com true http://www.bkjia.com/PHPjc/958258.html techarticle Linux Implementation timed PHP script, Linux execute PHP script in linux input command copy code code as follows: CRONTAB-E then use the VIM command to edit the open file, enter copy ...