{"id":219,"date":"2021-01-14T08:45:54","date_gmt":"2021-01-14T00:45:54","guid":{"rendered":"https:\/\/22pig.com\/?p=219"},"modified":"2021-01-14T08:45:54","modified_gmt":"2021-01-14T00:45:54","slug":"crontab-%e4%bf%ae%e6%94%b9","status":"publish","type":"post","link":"http:\/\/22pig.com\/?p=219","title":{"rendered":"crontab \u4fee\u6539"},"content":{"rendered":"<p>crontab -e<\/p>\n<p>\u8fd8\u53ef\u4ee5\u5148\u4fee\u6539\u5230\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff0c\u518d\u8fdb\u884c\u52a0\u8f7d<\/p>\n<p>echo &#8217;55 23 * * * user killall -9 java&#8217; &gt;&gt; \/etc\/crontab<br \/>\necho &#8217;56 23 * * * user \/home\/user\/Resin\/bin\/startresin.sh&#8217; &gt;&gt; \/etc\/crontab<\/p>\n<p>#\u4f1a\u8986\u76d6\u6389\u539f\u6765\u7684\u6570\u636e\uff0c\u614e\u7528<\/p>\n<p><strong>crontab \/etc\/crontab\u00a0 \u00a0<\/strong><\/p>\n<p>SHELL=\/bin\/bash<br \/>\nPATH=\/sbin:\/bin:\/usr\/sbin:\/usr\/bin<br \/>\nMAILTO=root<\/p>\n<p># For details see man 4 crontabs<\/p>\n<p># Example of job definition:<br \/>\n# .&#8212;&#8212;&#8212;&#8212;&#8212;- minute (0 &#8211; 59)<br \/>\n# | .&#8212;&#8212;&#8212;&#8212;- hour (0 &#8211; 23)<br \/>\n# | | .&#8212;&#8212;&#8212;- day of month (1 &#8211; 31)<br \/>\n# | | | .&#8212;&#8212;- month (1 &#8211; 12) OR jan,feb,mar,apr &#8230;<br \/>\n# | | | | .&#8212;- day of week (0 &#8211; 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat<br \/>\n# | | | | |<br \/>\n# * * * * * user-name command to be executed<\/p>\n<p>55 23 * * * user killall -9 java<br \/>\n56 23 * * * user \/home\/user\/Resin\/bin\/startresin.sh<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>crontab -e \u8fd8\u53ef\u4ee5\u5148\u4fee\u6539\u5230\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff0c\u518d\u8fdb\u884c\u52a0\u8f7d echo &#8217;55 23 * * * user killall -9 java&#8217; &gt;&gt; \/etc\/crontab echo &#8217;56 23 * * * user \/home\/user\/Resin\/bin\/startresin.sh&#8217; &gt;&gt; \/etc\/crontab #\u4f1a\u8986\u76d6\u6389\u539f\u6765\u7684\u6570\u636e\uff0c\u614e\u7528 crontab \/etc\/crontab\u00a0 \u00a0 SHELL=\/bin\/bash PATH=\/sbin:\/bin:\/usr\/sbin:\/usr\/bin MAILTO=root # For details see man 4 crontabs # Example of job definition: # .&#8212;&#8212;&#8212;&#8212;&#8212;- minute (0 &#8211; 59) # | .&#8212;&#8212;&#8212;&#8212;- hour (0 &#8230; <a title=\"crontab \u4fee\u6539\" class=\"read-more\" href=\"http:\/\/22pig.com\/?p=219\" aria-label=\"More on crontab \u4fee\u6539\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-219","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"http:\/\/22pig.com\/index.php?rest_route=\/wp\/v2\/posts\/219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/22pig.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/22pig.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/22pig.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/22pig.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=219"}],"version-history":[{"count":0,"href":"http:\/\/22pig.com\/index.php?rest_route=\/wp\/v2\/posts\/219\/revisions"}],"wp:attachment":[{"href":"http:\/\/22pig.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/22pig.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=219"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/22pig.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}