﻿{"id":7374,"date":"2021-04-14T15:49:48","date_gmt":"2021-04-14T07:49:48","guid":{"rendered":"https:\/\/www.linuxmi.com\/?p=7374"},"modified":"2021-04-14T15:49:48","modified_gmt":"2021-04-14T07:49:48","slug":"zeit-linux-crontab","status":"publish","type":"post","link":"https:\/\/www.linuxmi.com\/zeit-linux-crontab.html","title":{"rendered":"Zeit &#8211; Linux\u4e2d\u5b9a\u65f6\u4efb\u52a1\u548c\u4e34\u65f6\u4efb\u52a1\u7684\u56fe\u5f62\u5316\u5de5\u5177"},"content":{"rendered":"<p>Zeit\u662f\u4e00\u4e2a\u5f00\u6e90\u7684GUI\u5de5\u5177\uff0c\u901a\u8fc7\u201ccrontab\u201d\u548c\u201cat\u201d\u6765\u8c03\u5ea6\u4f5c\u4e1a\u3002\u5b83\u662f\u7528C++\u7f16\u5199\u7684\uff0c\u5728GPL-3.0\u8bb8\u53ef\u4e0b\u53d1\u5e03\u3002\u662f\u4e00\u79cd\u6613\u4e8e\u4f7f\u7528\u7684\u5de5\u5177\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u63a5\u53e3\uff0c\u53ef\u4ee5\u8c03\u5ea6\u4e00\u6b21\u6027\u4f5c\u4e1a\u6216\u8fed\u4ee3\u4f5c\u4e1a\u3002Zeit\u8fd8\u914d\u6709\u95f9\u949f\u548c\u8ba1\u65f6\u5668\uff0c\u53ef\u4ee5\u901a\u8fc7\u58f0\u97f3\u901a\u77e5\u7528\u6237\u3002<\/p>\n<p><strong>Zeit \u7684\u7279\u6027<\/strong><\/p>\n<ul>\n<li>\u8c03\u5ea6\u3001\u4fee\u6539\u6216\u5220\u9664CRON\u4f5c\u4e1a\u3002<\/li>\n<li>\u5b89\u6392\u6216\u5220\u9664\u5de5\u4f5c\u3002<\/li>\n<li>\u8ba1\u5212\uff0c\u4fee\u6539\u6216\u5220\u9664\u5b9a\u65f6\u5668\/\u8b66\u62a5\u3002<\/li>\n<li>\u4fee\u6539\u73af\u5883\u53d8\u91cf\u3002<\/li>\n<\/ul>\n<p><strong>\u5982\u4f55\u5728Linux\u4e0b\u5b89\u88c5Zeit<\/strong><\/p>\n<p>\u5bf9\u4e8eUbuntu\u548c\u57fa\u4e8eUbuntu\u7684\u53d1\u884c\u7248\uff0c\u53ef\u4ee5\u50cf\u4e0b\u9762\u63d0\u5230\u7684\u90a3\u6837\uff0c\u901a\u8fc7\u6dfb\u52a0PPA\u5b58\u50a8\u5e93\u6765\u5b89\u88c5\u7a33\u5b9a\u7248\u3002<\/p>\n<p>$ sudo add-apt-repository ppa:blaze\/main<br \/>\n$ sudo apt update<br \/>\n$ sudo apt install zeit<\/p>\n<p>\u60a8\u8fd8\u53ef\u4ee5\u901a\u8fc7\u6dfb\u52a0\u4ee5\u4e0bPPA\u5b58\u50a8\u5e93\u6765\u5c1d\u8bd5Zeit\u7684\u5f00\u53d1\u7248\u672c\u3002<\/p>\n<p>$ sudo add-apt-repository ppa:blaze\/dev<br \/>\n$ sudo apt update<br \/>\n$ sudo apt install zeit<\/p>\n<p>\u5bf9\u4e8e\u5176\u4ed6Linux\u53d1\u884c\u7248\uff0c\u60a8\u53ef\u4ee5\u4ece\u5982\u4e0b\u6240\u793a\u7684\u6e90\u4ee3\u7801\u6784\u5efa\u5b83\u3002<\/p>\n<p>$ git clone https:\/\/github.com\/loimu\/zeit.git<br \/>\n$ mkdir build &amp;&amp; cd build<br \/>\n$ cmake ..<br \/>\n$ make -j2<br \/>\n$ .\/src\/zeit<\/p>\n<p>\u8981\u542f\u52a8Zeit\uff0c\u53ea\u9700\u8f93\u5165\u3002<\/p>\n<p>$ zeit &amp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7376\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2021\/04\/zeit.png\" alt=\"\" width=\"1163\" height=\"802\" \/><\/p>\n<p><strong>\u4f7f\u7528at\u547d\u4ee4\u6267\u884c\u975e\u5468\u671f\u547d\u4ee4<\/strong><\/p>\n<p>\u975e\u5b9a\u671f\u547d\u4ee4\u5141\u8bb8\u8c03\u5ea6\u547d\u4ee4\u8fd0\u884c\u4e00\u6b21\u3002\u662f\u7684\uff0c\u5c31\u8fd9\u6837\u3002\u5b83\u4f7f\u7528\u201c at\u201d\u547d\u4ee4\u3002\u8f6c\u5230\u201c\u67e5\u770b\u2192\u9009\u62e9 \u975e\u5468\u671f\u6027\u547d\u4ee4(<strong>VIEW<\/strong> \u2192\u9009\u62e9\u00a0<strong>NONPERIODIC COMMANDS<\/strong>)\u201d\u6216\u6309\u201c CTRL + N \u201d\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-7379 size-full\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2021\/04\/zeit-2.png\" alt=\"\" width=\"873\" height=\"473\" \/><\/p>\n<p>\u9009\u62e9\u201c\u6dfb\u52a0\u547d\u4ee4<strong>Add Command<\/strong>\u201d\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u7136\u540e\u6dfb\u52a0\u6761\u76ee\u3002\u6211\u6b63\u5728\u8ba1\u5212\u8981\u572815:23\u8fd0\u884c\u7684\u547d\u4ee4\u3002\u6b64\u547d\u4ee4\u5c06\u5728\u201cwww.linuxmi.com\u201d\u6587\u4ef6\u5939\u4e2d\u521b\u5efa\u4e00\u4e2a\u7a7a\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u5e76\u5728\u6587\u4ef6\u540d\u4e2d\u6dfb\u52a0\u4e86\u4eca\u5929\u7684\u65e5\u671f\uff0c\u5982\u4e0b\u6240\u793a\u3002<\/p>\n<p>NOW=$(date +%F); touch \/home\/linuxmi\/www.linuxmi.com\/log_${NOW}.txt<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7378\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2021\/04\/zeit-1.png\" alt=\"\" width=\"867\" height=\"472\" \/><\/p>\n<p>\u73b0\u5728\u6dfb\u52a0\u4e86\u4e00\u4e2a\u6761\u76ee\u3002\u60a8\u65e0\u6cd5\u4fee\u6539\u8ba1\u5212\u7684\u547d\u4ee4\uff0c\u4f46\u662f\u53ef\u4ee5\u4f7f\u7528\u201c Delete Command \u201d\u5728\u8fd0\u884c\u4e4b\u524d\u5220\u9664\u8be5\u547d\u4ee4\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7380\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2021\/04\/ubuntu-20.04.2-2021-04-14-15-23-34.png\" alt=\"\" width=\"868\" height=\"473\" \/><\/p>\n<p>\u5220\u9664\u547d\u4ee4<\/p>\n<p>\u572815:23\uff0c\u547d\u4ee4\u5c06\u5982\u671f\u8fd0\u884c\uff0c\u5e76\u521b\u5efa\u4e86\u4e00\u4e2a\u7a7a\u7684\u65e5\u5fd7\u6587\u4ef6\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7381\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2021\/04\/zeit-3.png\" alt=\"\" width=\"866\" height=\"299\" \/><\/p>\n<p>\u547d\u4ee4\u6210\u529f\u6267\u884c<\/p>\n<p><strong>\u4f7f\u7528Cron\u4f5c\u4e1a\u8fd0\u884c\u5b9a\u65f6\u4efb\u52a1<\/strong><\/p>\n<p>\u8981\u8ba1\u5212Cron\u4f5c\u4e1a\uff0c\u8bf7\u9009\u62e9\u201c\u5b9a\u671f\u4efb\u52a1<strong>periodic task<\/strong>\u201d\u6216\u6309\u201c CTRL + P \u201d\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0czeit\u5c06\u4ee5\u201c\u5b9a\u65f6\u4efb\u52a1\u201d\u542f\u52a8\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7382\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2021\/04\/zeit4.png\" alt=\"\" width=\"865\" height=\"476\" \/><\/p>\n<p>\u5b89\u6392\u5b9a\u65f6\u4efb\u52a1<\/p>\n<p>\u8f93\u5165\u63cf\u8ff0\uff0c\u547d\u4ee4\u548c\u8ba1\u5212\u65f6\u95f4\uff0c\u7136\u540e\u6309OK\u5c06\u6761\u76ee\u6dfb\u52a0\u5230crontab\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7384\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2021\/04\/ubuntu-20.04.2-2021-04-14-15-41-01.png\" alt=\"\" width=\"870\" height=\"476\" \/><\/p>\n<p>\u8ba1\u5212\u8981\u8fd0\u884c\u7684\u547d\u4ee4<\/p>\n<p>\u73b0\u5728\u6211\u7684\u5de5\u4f5c\u8ba1\u5212\u5728\u6bcf\u592915:42\u8fdb\u884c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7385\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2021\/04\/zeit-4.png\" alt=\"\" width=\"867\" height=\"472\" \/><\/p>\n<p>\u8ba1\u5212\u4efb\u52a1<\/p>\n<p>\u60a8\u53ef\u4ee5\u4f7f\u7528\u201c crontab -l \u201d\u68c0\u67e5crontab \uff0c\u5728\u8be5\u4f4d\u7f6e\u5c06\u81ea\u52a8\u6dfb\u52a0\u6761\u76ee\u3002<\/p>\n<p>linuxmi@linuxmi:~\/www.linuxmi.com$ <span style=\"color: #ff0000;\">crontab -l<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7386\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2021\/04\/zeit-5.png\" alt=\"\" width=\"866\" height=\"255\" \/><\/p>\n<p>\u5217\u51faCron\u5de5\u4f5c<\/p>\n<p>\u9664\u4e86\u201c at \u201d\u548c\u201c crontab \u201d\u5916\uff0c\u8fd8\u6709\u4e24\u4e2a\u4f7f\u7528\u95f9\u949f\/\u8ba1\u65f6\u5668\u7684\u529f\u80fd\uff0c\u901a\u8fc7\u8c03\u7528\u58f0\u97f3\u6765\u63d0\u9192\u6211\u4eec\u3002\u8be5\u6761\u76ee\u4e5f\u5c06\u6dfb\u52a0\u5230crontab\u4e2d\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7387\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2021\/04\/ubuntu-20.04.2-2021-04-14-15-46-27.png\" alt=\"\" width=\"866\" height=\"477\" \/><\/p>\n<p>\u5c06\u8b66\u62a5\u8bbe\u7f6e\u4e3a\u8ba1\u5212\u4efb\u52a1<\/p>\n<p>\u672c\u6587\u5c31\u662f\u8fd9\u6837\u3002\u63a2\u7d22Zeit\uff0c\u5e76\u4e0e\u6211\u4eec\u5206\u4eab\u60a8\u7684\u53cd\u9988\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Zeit\u662f\u4e00\u4e2a\u5f00\u6e90\u7684GUI\u5de5\u5177\uff0c\u901a\u8fc7\u201ccrontab\u201d\u548c\u201cat\u201d\u6765\u8c03\u5ea6\u4f5c\u4e1a\u3002\u5b83\u662f\u7528C++\u7f16\u5199\u7684\uff0c\u5728G &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3],"tags":[672],"class_list":["post-7374","post","type-post","status-publish","format-standard","hentry","category-linux","tag-zeit"],"aioseo_notices":[],"views":1489,"_links":{"self":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts\/7374","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/comments?post=7374"}],"version-history":[{"count":3,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts\/7374\/revisions"}],"predecessor-version":[{"id":7388,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts\/7374\/revisions\/7388"}],"wp:attachment":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/media?parent=7374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/categories?post=7374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/tags?post=7374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}