linux中使用crontab实现定时任务
来源:互联网 发布:批发衣服软件 编辑:程序博客网 时间:2024/06/07 03:19
这个其实弄明白了简单的,这里我本人没有使用shell脚本实现,下面是我亲测的:
首先在命令行里输入:crontab -e 来进行编辑定时任务:
我这里是每天14:24执行任务, 执行的语句是:python3 p.py 后面加p.py的文件的路径,>> 是把打印的日志输出到/tmp/p1.log,这个文件里。# /home/laimeng/p.py# coding=utf8import datetimenow = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")print("任务执行,现在时间是:%s" %now)
- 下面是执行的结果: vi /tmp/p1.log
3.其中crontab的简单格式:
* * * * * command 分 时 日 月 周 命令 第1列表示分钟1~59 每分钟用*或者 */1表示 第2列表示小时1~23(0表示0点) 第3列表示日期1~31 第4列表示月份1~12 第5列标识号星期0~6(0表示星期天) 第6列要运行的命令
阅读全文
0 0
- linux中使用crontab实现定时任务
- linux使用crontab实现php定时任务
- Linux中定时任务crontab
- linux Crontab 使用 --定时任务
- linux使用crontab定时任务
- linux中crontab的用法,shell实现定时任务
- linux使用crontab实现PHP执行定时任务
- linux使用crontab实现PHP执行定时任务
- linux使用crontab实现PHP执行定时任务
- linux使用crontab实现PHP执行定时任务
- linux使用crontab实现PHP执行定时任务
- linux使用crontab实现PHP执行定时计划任务
- linux使用crontab实现PHP执行定时任务
- linux使用crontab实现PHP执行计划定时任务
- linux使用crontab实现PHP执行定时任务
- linux使用crontab实现PHP执行计划定时任务
- linux使用crontab实现PHP执行计划定时任务
- linux使用crontab实现PHP执行计划定时任务
- i2s总线规范
- pragma指令简介
- 链表
- 数据结构第二次上机 第二章之单链表
- 2017.11.4总结
- linux中使用crontab实现定时任务
- Go游戏服务器开发的一些思考(二十二):Godep包管理介绍
- 文章标题
- C++实现二叉堆
- printf()输出结果
- PS入门基础<1>
- Java高级篇-12-静态导入
- Elasticsearch[es]的命令总结
- 5.5