linux定时任务

格式

*  *  *  *  *  command
分  时   日   月   周   命令

如果星号后面加 /数字,就是当时量级的数量

例如:

一分钟执行一次

*/1  *  *  *  *  command

一小时执行一次

*  */1  *  *  *  command

添加定时计划任务

crontab -e

举个粟子:

* * * * * /alidata/server/php/bin/php /data/www/ttt.php
*/1 * * * * curl http://www.aabb.com/index.php/order-ttt.html

(注:第一种是调用php程序来执行php文件脚本,第二种是使用curl来访问网页链接来执行脚本)

原文地址:https://www.cnblogs.com/tujia/p/5546859.html