Add timed tasks to execute php files under Ubuntu


//Add automatic download timing task
1. vim /etc/crontab
2. Add #execute every 5 minutes
*/5 * * * * root /usr/bin/php /home/wwwroot/123.php
3. /etc/ init.d/cron restart Restart cron
4. Set the cron log storage path
sudo vi /etc/rsyslog.d/50-default.conf
delete the # before #cron.*
5. Restart the rsyslog service
/etc/init. d/rsyslog restart
/etc/init.d/cron restart restart cron
6. View the log file
vim /var/log/cron.log
//Reference address
https://blog.csdn.net/LOUISLIAOXH/article/details/48242289

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324611867&siteId=291194637