{"id":4496,"date":"2021-07-24T10:22:35","date_gmt":"2021-07-24T02:22:35","guid":{"rendered":"http:\/\/blog.ywdevops.cn\/?p=4496"},"modified":"2022-06-21T18:12:03","modified_gmt":"2022-06-21T10:12:03","slug":"linux-7","status":"publish","type":"post","link":"https:\/\/blog.ywdevops.cn\/index.php\/2021\/07\/24\/linux-7\/","title":{"rendered":"linux\u65f6\u95f4\u65f6\u533a\u4fee\u6539"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u6709\u7684Linux\u670d\u52a1\u5668\u7684\u65f6\u95f4\u9ed8\u8ba4\u4e0d\u662f\u5317\u4eac\u65f6\u95f4\uff0c\u4e0b\u9762\u8868\u793a\u65f6\u95f4\u4e3a\u7f8e\u56fd\u4e1c\u90e8\u65f6\u95f4\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"555\" height=\"102\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/07\/24.png\" alt=\"\" class=\"wp-image-4497\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/07\/24.png 555w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/07\/24-300x55.png 300w\" sizes=\"auto, (max-width: 555px) 100vw, 555px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u6267\u884c\u5982\u4e0b\u547d\u4ee4\uff0c\u4fee\u6539\u65f6\u533a\uff0c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv \/etc\/localtime \/etc\/localtime.bak\nln -s \/usr\/share\/zoneinfo\/Asia\/Shanghai  \/etc\/localtime<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"592\" height=\"52\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/07\/25.png\" alt=\"\" class=\"wp-image-4498\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/07\/25.png 592w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/07\/25-300x26.png 300w\" sizes=\"auto, (max-width: 592px) 100vw, 592px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u540e\u5728\u6267\u884cdate\u547d\u4ee4\uff0c\u53ef\u4ee5\u770b\u5230\u65f6\u95f4\u5df2\u7ecf\u53d8\u6210\u5317\u4eac\u65f6\u95f4\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"552\" height=\"126\" src=\"http:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/07\/26.png\" alt=\"\" class=\"wp-image-4499\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/07\/26.png 552w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2021\/07\/26-300x68.png 300w\" sizes=\"auto, (max-width: 552px) 100vw, 552px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u673a\u5668\u53ef\u4ee5\u4e0a\u7f51\uff0c\u8fd8\u53ef\u4ee5\u901a\u8fc7\u540c\u6b65\u7f51\u7edc\u65f6\u95f4\u670d\u52a1\u5668\u6765\u5b9e\u73b0\u66f4\u65b0\u65f6\u95f4<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1\u3001\u9996\u5148\u5b89\u88c5ntpdate\uff0c\u53ef\u76f4\u63a5\u6267\u884c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum -y install ntpdate<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">2\u3001\u901a\u8fc7ntpdate\u6765\u540c\u6b65\u65f6\u95f4\uff0c\u9996\u5148\u8981\u786e\u4fdd\u53ef\u4ee5ping \u901a\uff0c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u540c\u6b65\nntpdate -u cn.pool.ntp.org\n\n#\u5e38\u7528ntp\u670d\u52a1\u5668\u5982\u4e0b\uff1a\nNTP\u670d\u52a1\u5668(\u4e0a\u6d77) \uff1antp.api.bz\n\u4e2d\u56fdntp\u670d\u52a1\u5668\uff1acn.pool.ntp.org\n\u56fd\u5bb6\u6388\u65f6\u4e2d\u5fc3\u65b0\u7684NTP\u670d\u52a1\u5668\u5730\u5740\uff1antp.ntsc.ac.cn<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">3\u3001\u5199\u5165\u786c\u4ef6\u65f6\u95f4\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> \u670d\u52a1\u5668\u6bcf\u6b21\u91cd\u542f\u90fd\u4f1a\u53c2\u8003\u786c\u4ef6\u7684\u65f6\u95f4\uff0c\u6240\u4ee5\u9700\u8981\u5c06\u5f53\u524d\u7cfb\u7edf\u7684\u65f6\u95f4\u5199\u5165\u5230\u786c\u4ef6 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#\u67e5\u770b\u5f53\u524d\u786c\u4ef6\u65f6\u95f4\uff1a\nhwclock -r\n#\u5199\u5165\u786c\u4ef6\u65f6\u95f4\uff1a\nhwclock -w<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">4\u3001 \u914d\u7f6e\u5f00\u673a\u542f\u52a8\u6821\u9a8c <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim \/etc\/rc.d\/rc.local\n\/usr\/sbin\/ntpdate -u cn.pool.ntp.org&gt; \/dev\/null 2&gt;&amp;1; \/sbin\/hwclock -w<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">5\u3001 \u914d\u7f6e\u5b9a\u65f6\u4efb\u52a1 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>crontab -e\n00 10 * * * \/usr\/sbin\/ntpdate -u cn.pool.ntp.org &gt; \/dev\/null 2&gt;&amp;1; \/sbin\/hwclock -w<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u7684Linux\u670d\u52a1\u5668\u7684\u65f6\u95f4\u9ed8\u8ba4\u4e0d\u662f\u5317\u4eac\u65f6\u95f4\uff0c\u4e0b\u9762\u8868\u793a\u65f6\u95f4\u4e3a\u7f8e\u56fd\u4e1c\u90e8\u65f6\u95f4\uff0c\u5982\u56fe\uff1a \u6267\u884c\u5982\u4e0b\u547d\u4ee4\uff0c\u4fee\u6539\u65f6\u533a\uff0c\u5982\u4e0b\uff1a [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":4500,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,94],"tags":[48],"class_list":["post-4496","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-problem-2","tag-linux"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":8}},"_links":{"self":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/4496","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/comments?post=4496"}],"version-history":[{"count":5,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/4496\/revisions"}],"predecessor-version":[{"id":9210,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/4496\/revisions\/9210"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media\/4500"}],"wp:attachment":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media?parent=4496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/categories?post=4496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/tags?post=4496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}