{"id":538,"date":"2020-09-05T02:56:10","date_gmt":"2020-09-04T18:56:10","guid":{"rendered":"https:\/\/dell755.cith.ddnsfree.com:5444\/?p=538"},"modified":"2020-09-05T02:57:09","modified_gmt":"2020-09-04T18:57:09","slug":"centos7-%e8%ae%be%e7%bd%ae%e5%ae%9a%e6%97%b6%e9%87%8d%e5%90%af","status":"publish","type":"post","link":"https:\/\/blog.cithwu.com\/wp5444\/centos7-%e8%ae%be%e7%bd%ae%e5%ae%9a%e6%97%b6%e9%87%8d%e5%90%af\/","title":{"rendered":"CentOS7 \u8bbe\u7f6e\u5b9a\u65f6\u91cd\u542f"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">1.\u7f16\u8f91\u914d\u7f6e<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">vi \/etc\/crontab<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2.\u8bbe\u7f6e\u91cd\u542f\u65f6\u95f4<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SHELL=\/bin\/bash\nPATH=\/sbin:\/bin:\/usr\/sbin:\/usr\/bin\nMAILTO=root\n\n# For details see man 4 crontabs\n\n# Example of job definition:\n# .---------------- minute (0 - 59)\n# |  .------------- hour (0 - 23)\n# |  |  .---------- day of month (1 - 31)\n# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...\n# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat\n# |  |  |  |  |\n# *  *  *  *  * user-name  command to be executed\n20 04 * * * root reboot #04:20 \u6bcf\u5929\u51cc\u66684\u70b920\u5206\u91cd\u542f\u7cfb\u7edf\n*\/10 * * * * root reboot  #10\u5206\u949f\u91cd\u542f\u4e00\u6b21\n* *\/4 * * * root reboot  #\u96944\u4e2a\u5c0f\u65f6\u91cd\u542f\u4e00\u6b21<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">3.\u88c5\u8f7d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">crontab \/etc\/crontab<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4.\u91cd\u542f\u5b9a\u65f6\u670d\u52a1<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">systemctl enable crond.service #\u5f00\u542f\u542f\u52a8<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">systemctl restart crond.service #\u91cd\u542f\u670d\u52a1<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">5.\u67e5\u770b\u5b9a\u65f6\u914d\u7f6e<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">crontab -l<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u67e5\u770b\u7cfb\u7edf\u91cd\u542f\u60c5\u51b5(\u5e38\u7528\u65b9\u6cd5)\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">last reboot<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">who -b<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.\u7f16\u8f91\u914d\u7f6e vi \/etc\/c&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-538","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/posts\/538","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/comments?post=538"}],"version-history":[{"count":1,"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/posts\/538\/revisions"}],"predecessor-version":[{"id":539,"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/posts\/538\/revisions\/539"}],"wp:attachment":[{"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/media?parent=538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/categories?post=538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/tags?post=538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}