As used herein, the linux
inside crontab
of the timing tasks running php
program
A. crontab
Use the command
crontab -e
Enter crontab
service crond restart/reload
reboot / reload crontab
(here crond
) tail -f /var/log/con
to view cron
the log
II. crontab
Text code
- Use
curl
scripts execute the script
0 3 * * * /usr/bin/curl http://xxx.com/api/method > /dev/null 2>&1 &
- Use
php
execute the script execution procedures
0 3 * * * /usr/bin/php http://xxx.com/api/method > /dev/null 2>&1 &
Use
php
scripts Note
1. The file must have access allowsphp
permission to execute the program read and write
2php
scripts and so can not use the $ _SERVERphp
superglobal (but this is way more quickly)
Also: with whereis 软件
can easily find software location
III. Time crontab cron job description
*/1 * * * *
Once per minute0 3 * * *
executed once a day at 3 amAddress verification crontab time
https://crontab.guru/
Reproduced in: https: //www.jianshu.com/p/960748e0fe2b