crontab 常用命令

本文档介绍了如何使用CronTab进行定时任务的配置,包括常见命令如crontab-e、crontab-l和crontab-r的具体用法,并提供了具体的PHP定时任务示例。此外还介绍了CronTab服务的启动、停止及重启命令。

* * * * * /usr/bin/php -f /home/wwwroot/test/a.php >> crontab.txt

*/1 * * * * /usr/bin/wget "http://139.196.18.164/index.php?c=index&a=crons"

 

crontab -e 编辑用户的 计划任务

crontab -l 查看计划任务列表

crontab -r : 删除目前的时程表


*/10 * * * * php /home/wwwroot/tp.5fuhu.com/artisan toupiao >> /home/wwwroot/tp.5hufu.com/test.txt

 

/sbin/service crond start 启动

/sbin/service crond stop //关闭服务

/sbin/service crond reload 重启


// tp.mm1738.com
*/20 * * * * php /home/wwwroot/tp.sidingli.com/artisan toupiao >> /home/wwwroot/tp.sidingli.com/test.txt


*/20 * * * * php /home/wwwroot/tp.5hufu.com/artisan toupiao >> /home/wwwroot/tp.5hufu.com/test.txt

 

crontab 安装
yum -y install vixie-cron
yum -y install crontabs

转载于:https://www.cnblogs.com/gudyu/p/7610011.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值