Skip to content

imsilence/crontab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

定时任务执行框架

简述

根据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,下个执行周期(每分钟执行一次)会应用到程序当中

crontab中配置的脚本必须同配置文件在相同目录下

About

定时任务执行框架

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages