扫码关注官方订阅号
工作时间内:09:00 - 17:00 一小时执行一次工作时间外:18:00 - 08:00 两小时执行一次周六,周日全天都是非工作时间
这个用crontab能否实现?
认证高级PHP讲师
# 工作时间内 * 9-17/1 * * 1,2,3,4,5 /path/to/your/script # 工作时间外 * 18-8/2 * * 6,0 /path/to/your/script
* 9-17/1 * * 1,2,3,4,5 /etc/init.d/yourcmd yourcmdparam* 18-8/2 * * 1,2,3,4,5 /etc/init.d/yourcmd yourcmdparam* */2 * * 6,0 /etc/init.d/yourcmd yourcmdparam
* 9-17/1 * * 1,2,3,4,5 /etc/init.d/yourcmd yourcmdparam
* 18-8/2 * * 1,2,3,4,5 /etc/init.d/yourcmd yourcmdparam
* */2 * * 6,0 /etc/init.d/yourcmd yourcmdparam
链接应该都可以,见上面的链接
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
* 9-17/1 * * 1,2,3,4,5 /etc/init.d/yourcmd yourcmdparam
* 18-8/2 * * 1,2,3,4,5 /etc/init.d/yourcmd yourcmdparam
* */2 * * 6,0 /etc/init.d/yourcmd yourcmdparam
链接
应该都可以,见上面的链接