{"id":818,"date":"2023-03-03T22:22:26","date_gmt":"2023-03-03T14:22:26","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=818"},"modified":"2023-04-29T16:52:47","modified_gmt":"2023-04-29T08:52:47","slug":"jenkins-set-scheduled-tasks","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/03\/jenkins-set-scheduled-tasks\/","title":{"rendered":"Jenkins\u8bbe\u7f6e\u5b9a\u65f6\u4efb\u52a1"},"content":{"rendered":"<p>\u6bcf\u6b21\u90fd\u624b\u52a8\u7684\u6784\u5efa\u9879\u76ee\u663e\u7136\u4e0d\u591f\u65b9\u4fbf\uff0c\u6709\u65f6\u5019\u9700\u8981\u5b9a\u65f6\u5730\u6267\u884c\u81ea\u52a8\u5316\u6d4b\u8bd5\u811a\u672c\u3002\u4f8b\u5982\uff0c\u6bcf\u5929\u665a\u4e0a\u5b9a\u65f6\u6267\u884c py_tests.py \u6587\u4ef6\u6765\u8fd0\u884c\u81ea\u52a8\u5316\u6d4b\u8bd5\u9879\u76ee\u3002<\/p>\n<h2>\u8bbe\u7f6e\u5b9a\u65f6\u4efb\u52a1<\/h2>\n<p><!-- more --><\/p>\n<p>\u6839\u636e\u524d\u9762\u5df2\u7ecf\u521b\u5efa\u7684 <strong>Python Test Project<\/strong> \u9879\u76ee\u4e3a\u4f8b\uff0c\u5355\u51fb\u9879\u76ee\u5de6\u4fa7\u7684 <strong>\u914d\u7f6e<\/strong> \u9009\u9879\uff0c\u4fee\u6539\u9879\u76ee\u7684\u914d\u7f6e\u3002<\/p>\n<p>\u627e\u5230 <strong>\u6784\u5efa\u89e6\u53d1\u5668<\/strong>\uff0c\u52fe\u9009 <strong>Build periodically<\/strong> \u9009\u9879\u3002<\/p>\n<p>\u901a\u8fc7\u67e5\u770b\u8bbe\u7f6e\u8bf4\u660e\uff0c\u6b64\u5904\u5b9a\u65f6\u4efb\u52a1\u7684\u683c\u5f0f\u9075\u5faa cron \u7684\u8bed\u6cd5\uff08\u53ef\u4ee5\u4e0e cron \u7684\u8bed\u6cd5\u6709\u8f7b\u5fae\u7684\u5dee\u5f02\uff09\u3002\u5177\u4f53\u683c\u5f0f\uff0c\u6bcf\u884c\u5305\u542b\u4e94\u4e2a\u5b57\u6bb5\uff0c\u901a\u8fc7 Tab \u6216\u7a7a\u683c\u5206\u9694\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">\u5b57\u6bb5<\/th>\n<th style=\"text-align: center;\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">MINUTE<\/td>\n<td style=\"text-align: center;\">Minutes within the hour (0\u201359)<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">HOUR<\/td>\n<td style=\"text-align: center;\">The hour of the day (0\u201323)<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">DOM<\/td>\n<td style=\"text-align: center;\">The day of the month (1\u201331)<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">MONTH<\/td>\n<td style=\"text-align: center;\">The month (1\u201312)<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">DOW<\/td>\n<td style=\"text-align: center;\">The day of the week (0\u20137) where 0 and 7 are Sunday<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote>\n<p>To allow periodically scheduled tasks to produce even load on the system, the symbol H (for \u201chash\u201d) should be used wherever possible. For example, using 0 0 <em> <\/em> <em> for a dozen daily jobs will cause a large spike at midnight. In contrast, using H H <\/em> <em> <\/em> would still execute each job once a day, but not all at the same time, better using limited resources.<\/p>\n<\/blockquote>\n<p>\u82e5\u8981\u6307\u5b9a\u4e00\u4e2a\u5b57\u6bb5\u7684\u591a\u4e2a\u503c\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u8fd0\u7b97\u7b26\uff0c\u6309\u5148\u540e\u987a\u5e8f\u3002<\/p>\n<ul>\n<li><code>*<\/code> \u6307\u5b9a\u6240\u6709\u503c<\/li>\n<li><code>M-N<\/code> \u6307\u5b9a\u8303\u56f4\u503c<\/li>\n<li><code>M-N\/X<\/code> \u6216 <code>*\/X<\/code> \u5728\u6307\u5b9a\u8303\u56f4\u6216\u6574\u4e2a\u6709\u6548\u8303\u56f4\u5185\u6309 X \u95f4\u9694\u7684\u6b65\u9aa4<\/li>\n<li><code>A,B,...,Z<\/code> \u5217\u4e3e\u591a\u4e2a\u503c<\/li>\n<\/ul>\n<p>\u4f8b\u5b50\uff1a<\/p>\n<p>\u6bcf15\u5206\u949f\u8fd0\u884c\u4e00\u6b21 (\u53ef\u80fd\u5728 1:07\u5206, 1:22\u5206, 1:37\u5206, 1:52\u5206)<\/p>\n<pre><code class=\"language-shell\">H\/15 * * * *<\/code><\/pre>\n<p>every ten minutes in the first half of every hour (three times, perhaps at :04, :14, :24)<\/p>\n<pre><code class=\"language-shell\">H(0-29)\/10 * * * *<\/code><\/pre>\n<p>\u6bcf\u5468\u4e00\u81f3\u5468\u4e94\uff0c\u4e0a\u53489:45\u5230\u4e0b\u53483:45\uff0c\u6bcf\u96942\u5c0f\u65f645\u5206\u949f\u8fd0\u884c\u4e00\u6b21<\/p>\n<pre><code class=\"language-shell\">45 9-16\/2 * * 1-5<\/code><\/pre>\n<p>\u6bcf\u4e24\u5c0f\u65f6\u4e00\u6b21\uff0c\u6bcf\u4e2a\u5de5\u4f5c\u65e5\u4e0a\u53489\u70b9\u5230\u4e0b\u53485\u70b9(\u4e5f\u8bb8\u662f\u4e0a\u534810:38\uff0c\u4e0b\u534812:38\uff0c\u4e0b\u53482:38\uff0c\u4e0b\u53484:38)<\/p>\n<pre><code class=\"language-shell\">H H(9-16)\/2 * * 1-5<\/code><\/pre>\n<p>\u966412\u6708\u5916\uff0c\u6bcf\u67081\u53f7\u548c15\u53f7\u6bcf\u5929\u4e00\u6b21<\/p>\n<pre><code class=\"language-shell\">H H 1,15 1-11 *<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6bcf\u6b21\u90fd\u624b\u52a8\u7684\u6784\u5efa\u9879\u76ee\u663e\u7136\u4e0d\u591f\u65b9\u4fbf\uff0c\u6709\u65f6\u5019\u9700\u8981\u5b9a\u65f6\u5730\u6267\u884c\u81ea\u52a8\u5316\u6d4b\u8bd5\u811a\u672c\u3002\u4f8b\u5982\uff0c\u6bcf\u5929\u665a\u4e0a\u5b9a\u65f6\u6267\u884c py_tests [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[91],"tags":[92,214],"class_list":["post-818","post","type-post","status-publish","format-standard","hentry","category-ci-cd","tag-jenkins","tag-214"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/818","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=818"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/818\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=818"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=818"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}