【Go开源宝藏】 go-cron 定时任务

1. cron是什么

1.1 cron简介

cron:计划任务,其实就是定时任务
和系统约个时间,在几点几分几秒或者每隔一段时间跑一个任务(job),就那么简单。

1.2 cron详细语法

  • 结构

以下的结构来自维基百科

# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;
# │ │ │ │ │                                   7 is also Sunday on some systems)
# │ │ │ │ │
# │ │ │ │ │
# * * * * *

猜你喜欢

转载自blog.csdn.net/weixin_45304503/article/details/121264740