Skip to content

Commit 934c7b3

Browse files
authored
Merge pull request me115#22 from lslxdx/21_7_per_hour
bug fix: '* 23-7/1 * * *'表示'23点到7点间的每1个小时的任意分钟执行一次', 所以正确的写法应该是'0 23-…
2 parents 440f761 + bbe0746 commit 934c7b3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

crontab.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ $ crontab -l
128128

129129
### 实例12:晚上11点到早上7点之间,每隔一小时重启smb
130130
命令:
131-
* 23-7/1 * * * /etc/init.d/smb restart
131+
0 23-7 * * * /etc/init.d/smb restart
132132

133133
### 实例13:每月的4号与每周一到周三的11点重启smb
134134
命令:

crontab.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ $ crontab <filename>
154154
实例12:晚上11点到早上7点之间,每隔一小时重启smb
155155
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
156156
命令:
157-
* 23-7/1 * * * /etc/init.d/smb restart
157+
0 23-7 * * * /etc/init.d/smb restart
158158

159159
实例13:每月的4号与每周一到周三的11点重启smb
160160
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tool/crontab.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ crontab的文件格式
162162
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
163163
::
164164

165-
* 23-7/1 * * * /etc/init.d/smb restart
165+
0 23-7 * * * /etc/init.d/smb restart
166166

167167
使用注意事项
168168
-----------------------

0 commit comments

Comments
 (0)