From bb9dadb6b62d1b1ef61d1c3e07f4f4fa4a7c9a10 Mon Sep 17 00:00:00 2001 From: zyimm Date: Mon, 7 Aug 2023 17:54:23 +0800 Subject: [PATCH 1/3] =?UTF-8?q?:art:=E6=A0=BC=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _posts/git/no-login-required.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/git/no-login-required.md b/_posts/git/no-login-required.md index 9981aed..ac4eeb0 100644 --- a/_posts/git/no-login-required.md +++ b/_posts/git/no-login-required.md @@ -14,7 +14,7 @@ tags: Git ssh-keygen -t rsa -C "your_email@example.com" ``` -`your_email@example.com` 是你自己的邮箱域名,该命令一路回车,生成一对rsa密钥并将电子邮件地址设置为“your_email@example.com”,你git仓库使用的邮箱与此对应。 +`your_email@example.com` 是你自己的邮箱域名,该命令一路回车,生成一对rsa密钥并将电子邮件地址设置为`your_email@example.com`,你git仓库使用的邮箱与此对应。 ### 第二步 git中设置密钥 From 02316d21281ea99584026e3a6ccbc8833d19ca07 Mon Sep 17 00:00:00 2001 From: zyimm Date: Wed, 27 Sep 2023 16:50:05 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=AB=A1=20=20Cron=20=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _posts/Linux/other/cron.md | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 _posts/Linux/other/cron.md diff --git a/_posts/Linux/other/cron.md b/_posts/Linux/other/cron.md new file mode 100644 index 0000000..347bc7f --- /dev/null +++ b/_posts/Linux/other/cron.md @@ -0,0 +1,44 @@ +--- +title: 🫡Cron 定时任务说明 +date: 2023-09-28 +tags: 定时任务 +--- + +时常记不住定时任务一些配置规则,所以这边记录一下!☘ + +Cron 定时任务是一种在 Unix/Linux 系统中用于执行预定时间间隔的任务的机制。它使用 cron 表达式来定义任务的执行时间。 + +Cron 表达式由空格分隔的五个字段组成,分别表示分钟、小时、日期、月份和星期几。每个字段可以接受不同的取值范围和特殊字符。 + +>以下是每个字段的取值范围和特殊字符的说明: + +分钟字段:取值范围是 0-59。 + +小时字段:取值范围是 0-23。 + +日期字段:取值范围是 1-31。 + +月份字段:取值范围是 1-12。 + +星期字段:取值范围是 0-7,其中 0 和 7 都表示星期日。 + +> 对于每个字段,可以使用以下特殊字符来定义更复杂的定时任务: + +星号(*):表示匹配该字段的所有可能值。 + +逗号(,):用于分隔多个取值,表示匹配任意一个取值。 + +连字符(-):用于指定一个范围,表示匹配该范围内的所有值。 + +斜杠(/):用于指定一个步长,表示匹配该步长的所有值。 + + +> 以下是一些常见的 cron 表达式示例: + + +1. `0 0 * * *`:每天的 00:00 执行一次任务。 +2. `0 12 * * 1-5`:周一至周五的 12:00 执行一次任务。 +3. `0 0 1 * *`:每个月的第一天的 00:00 执行一次任务。 +4. `0 */2 * * *`:每隔两个小时执行一次任务。 + +Cron 定时任务是一种非常灵活和强大的调度机制,可以帮助自动化执行定期任务,例如备份、清理、数据同步等。 \ No newline at end of file From c237f893d868077508fb4ddba74fa790bf2e2a8a Mon Sep 17 00:00:00 2001 From: zyimm Date: Wed, 27 Sep 2023 16:55:29 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=AB=A1=20=20Cron=20=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _posts/Linux/other/cron.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/_posts/Linux/other/cron.md b/_posts/Linux/other/cron.md index 347bc7f..785744b 100644 --- a/_posts/Linux/other/cron.md +++ b/_posts/Linux/other/cron.md @@ -10,6 +10,11 @@ Cron 定时任务是一种在 Unix/Linux 系统中用于执行预定时间间隔 Cron 表达式由空格分隔的五个字段组成,分别表示分钟、小时、日期、月份和星期几。每个字段可以接受不同的取值范围和特殊字符。 +```shell +minute hour day month week command 顺序:分 时 日 月 周 + +``` + >以下是每个字段的取值范围和特殊字符的说明: 分钟字段:取值范围是 0-59。