Linux系统设置定时任务
来源:互联网 发布:windows live软件包 编辑:程序博客网 时间:2024/06/15 15:59
大家喜欢最直接的答案
首先需要启动crontab服务
service crond start #启动服务
service crond stop #关闭服务
service crond restart #重启服务
service crond reload #重新载入配置
service crond stop #关闭服务
service crond restart #重启服务
service crond reload #重新载入配置
crontab -e 编辑crontab服务文件
输入
*/10 * * * * php /home/wwwroot/default/index.php
表示每隔10分钟执行一次 (php /home/wwwroot/default/index.php)命令
保存并退出即可
查看正在执行的服务 crontab -l
每一行的格式为:分 时 日 月 周 命令
第1列表示分钟1~59 每分钟用*或者 */1表示
第2列表示小时1~23(0表示0点)
第3列表示日期1~31
第4列表示月份1~12
第5列标识号星期0~6(0表示星期天)
第6列要运行的命令
几个特殊符号的含义:
“*”代表取值范围内的数字,
“/”代表”每”,
“-”代表从某个数字到某个数字,
“,”分开几个离散的数
在crontab中,命令还是文件的路径都要写全!
0 */3 * * * #表示每隔3个小时执行。 30 3 * * 6 #表示每周六的3点30分执行。 0 0 1,20 * * #表示每个月的1号和20号执行。 10 5 */5 * * #表示每个月的5号、10号、15号、20号、25号、30号的5点10分执行。
0 0
- Linux 系统设置定时任务
- Linux系统设置定时任务
- Linux系统设置定时任务
- Linux系统设置定时任务
- Linux定时任务设置
- Linux设置定时任务
- Linux定时任务设置
- Linux定时任务设置
- linux设置定时任务
- linux设置定时任务
- 【Linux】设置定时任务
- linux设置定时任务
- linux设置定时任务
- 设置linux定时任务
- Linux设置定时任务
- Linux 系统定时任务
- Linux 系统定时任务
- LINUX系统定时任务
- VS2010与SVN
- 未安装excel delphi listview导出到excel
- RejectedExecutionException
- Linux操作系统中/sbin/init程序的执行过程
- Vert.x 3学习笔记---14( Web篇 )
- Linux系统设置定时任务
- 那些 ~修饰符
- 一分钟认识 Git
- MATLAB硕博联盟招聘
- 树莓派增加触摸开关模块
- 沉浸式状态栏与界面adjustResize之间的bug解决方案
- UIPresentationController 注意事项
- LinearLayout布局——权重布局
- LeetCode题解:Single Number III