【文件属性】:
文件名称:crontab:定时任务执行框架
文件大小:10KB
文件格式:ZIP
更新时间:2021-05-16 07:08:16
Python
定时任务执行框架
简述
根据crontab中的配置定时执行指定的脚本,配置文件内容格式如下:
#* * * * * command
#分 时 日 月 周 命令
#第1列表示分钟1~59 每分钟用*或者 */1表示
#第2列表示小时1~23(0表示0点)
#第3列表示日期1~31
#第4列表示月份1~12
#第5列标识号星期0~6(0表示星期天)
#第6列要运行的命令
#测试脚本(每分钟执行一次python test.py脚本)
* * * * * python test.py
程序启动 python main.py
crontab配置文件需要放置在crontab/scripts目录或其子孙目录中
程序启动后会监控crontab/scripts目录下的所有crontab,只要发生添加、修改、删除crontab文件,程序自动重新加
【文件预览】:
crontab-master
----logging.cfg(623B)
----utils()
--------fmonitor.py(2KB)
--------crontab.py(4KB)
--------__init__.py(39B)
--------logwatcher.py(1KB)
--------cmdutils.py(2KB)
--------crypt.py(796B)
--------fileutils.py(2KB)
--------runserver.py(3KB)
----scripts()
--------test.py(179B)
--------crontab(328B)
----readme.md(937B)
----gconf.py(127B)
----main.py(1013B)
----pid(0B)