anacron<\/strong><\/div>\n\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0ccron \u7cfb\u7edf\u7684\u5927\u90e8\u5206\u5185\u5bb9\u90fd\u88ab\u8ba4\u4e3a\u662f\u7cfb\u7edf\u7ba1\u7406\u5458\u7684\u9886\u57df\uff0c\u56e0\u4e3a\u5b83\u901a\u5e38\u7528\u4e8e\u91cd\u8981\u7684\u5e95\u5c42\u4efb\u52a1\uff0c\u5982\u8f6e\u6362\u65e5\u5fd7\u6587\u4ef6\u548c\u66f4\u65b0\u8bc1\u4e66\u3002\u672c\u6587\u6f14\u793a\u7684\u914d\u7f6e\u662f\u4e3a\u666e\u901a\u7528\u6237\u8bbe\u7f6e\u4e2a\u4eba\u81ea\u52a8\u5316\u4efb\u52a1\u800c\u8bbe\u8ba1\u7684\u3002<\/p>\n
\u8981\u914d\u7f6e anacron \u6765\u8fd0\u884c\u4f60\u7684 cron \u4f5c\u4e1a\uff0c\u8bf7\u5728\u00a0\/.local\/etc\/anacrontab\u00a0\u521b\u5efa\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n
SHELL=\/bin\/sh\r\nPATH=\/sbin:\/bin:\/usr\/sbin:\/usr\/bin\r\n1 \u00a00 \u00a0cron.mine \u00a0 \u00a0run-parts \/home\/tux\/.local\/etc\/cron.daily\/<\/pre>\n\u8fd9\u4e2a\u6587\u4ef6\u544a\u8bc9 anacron \u6bcf\u5230\u65b0\u7684\u4e00\u5929\uff08\u4e5f\u5c31\u662f\u6bcf\u65e5\uff09\uff0c\u5ef6\u8fdf 0 \u5206\u949f\u540e\uff0c\u5c31\u8fd0\u884c\uff08run-parts\uff09\u6240\u6709\u5728\u00a0~\/.local\/etc\/cron.daily\u00a0\u4e2d\u627e\u5230\u7684\u53ef\u6267\u884c\u811a\u672c\u3002\u6709\u65f6\uff0c\u4f1a\u4f7f\u7528\u51e0\u5206\u949f\u7684\u5ef6\u8fdf\uff0c\u8fd9\u6837\u4f60\u7684\u8ba1\u7b97\u673a\u5c31\u4e0d\u4f1a\u5728\u4f60\u767b\u5f55\u540e\u5c31\u88ab\u6240\u6709\u53ef\u80fd\u7684\u4efb\u52a1\u51b2\u51fb\u3002\u4e0d\u8fc7\u8fd9\u4e2a\u8bbe\u7f6e\u9002\u5408\u6d4b\u8bd5\u3002<\/p>\n
cron.mine\u00a0\u503c\u662f\u8fdb\u7a0b\u7684\u4e00\u4e2a\u4efb\u610f\u540d\u79f0\u3002\u6211\u79f0\u5b83\u4e3a\u00a0cron.mine\uff0c\u4f46\u4f60\u4e5f\u53ef\u4ee5\u79f0\u5b83\u4e3a\u00a0cron.personal\u00a0\u6216\u00a0penguin\u00a0\u6216\u4efb\u4f55\u4f60\u60f3\u8981\u7684\u540d\u5b57\u3002<\/p>\n
\u9a8c\u8bc1\u4f60\u7684\u00a0anacrontab\u00a0\u6587\u4ef6\u7684\u8bed\u6cd5\uff1a<\/p>\n
$ anacron -T -t ~\/.local\/etc\/anacrontab \\\r\n-S \/home\/tux\/.var\/spool\/anacron<\/pre>\n\u6c89\u9ed8\u610f\u5473\u7740\u6210\u529f\u3002<\/p>\n
\u5728 .profile \u4e2d\u6dfb\u52a0 anacron<\/strong><\/div>\n\u6700\u540e\uff0c\u4f60\u5fc5\u987b\u786e\u4fdd anacron \u4ee5\u4f60\u7684\u672c\u5730\u914d\u7f6e\u8fd0\u884c\u3002\u56e0\u4e3a\u4f60\u662f\u4ee5\u666e\u901a\u7528\u6237\u800c\u4e0d\u662f root \u7528\u6237\u7684\u8eab\u4efd\u8fd0\u884c anacron\uff0c\u6240\u4ee5\u4f60\u5fc5\u987b\u5c06\u5b83\u5f15\u5bfc\u5230\u4f60\u7684\u672c\u5730\u914d\u7f6e\uff1a\u544a\u8bc9 anacron \u8981\u505a\u4ec0\u4e48\u7684\u00a0anacrontab\u00a0\u6587\u4ef6\uff0c\u4ee5\u53ca\u5e2e\u52a9 anacron \u8ddf\u8e2a\u6bcf\u4e00\u4e2a\u4f5c\u4e1a\u6700\u540e\u4e00\u6b21\u6267\u884c\u662f\u591a\u5c11\u5929\u7684 spool \u76ee\u5f55\uff1a<\/p>\n
anacron -fn -t \/home\/tux\/.local\/etc\/anacrontab \\\r\n-S \/home\/tux\/.var\/spool\/anacron<\/pre>\n-fn\u9009\u9879\u544a\u8bc9 anacron\u5ffd\u7565\u65f6\u95f4\u6233\uff0c\u8fd9\u610f\u5473\u7740\u4f60\u5f3a\u8feb\u5b83\u65e0\u8bba\u5982\u4f55\u90fd\u8981\u8fd0\u884c\u4f60\u7684 cron \u4f5c\u4e1a\u3002\u8fd9\u5b8c\u5168\u662f\u4e3a\u4e86\u6d4b\u8bd5\u7684\u76ee\u7684\u3002<\/p>\n
\u6d4b\u8bd5\u4f60\u7684 cron \u4f5c\u4e1a<\/strong><\/div>\n\u73b0\u5728\u4e00\u5207\u90fd\u8bbe\u7f6e\u597d\u4e86\uff0c\u4f60\u53ef\u4ee5\u6d4b\u8bd5\u4f5c\u4e1a\u4e86\u3002\u4ece\u6280\u672f\u4e0a\u8bb2\uff0c\u4f60\u53ef\u4ee5\u5728\u4e0d\u91cd\u542f\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u6d4b\u8bd5\uff0c\u4f46\u91cd\u542f\u662f\u6700\u6709\u610f\u4e49\u7684\uff0c\u56e0\u4e3a\u8fd9\u5c31\u662f\u8bbe\u8ba1\u7528\u6765\u5904\u7406\u4e2d\u65ad\u548c\u4e0d\u89c4\u5219\u7684\u767b\u5f55\u4f1a\u8bdd\u7684\u3002\u82b1\u70b9\u65f6\u95f4\u91cd\u542f\u7535\u8111\u3001\u767b\u5f55\uff0c\u7136\u540e\u5bfb\u627e\u6d4b\u8bd5\u6587\u4ef6\uff1a<\/p>\n
$ ls \/tmp\/hello\r\n\/tmp\/hello<\/pre>\n\u5047\u8bbe\u6587\u4ef6\u5b58\u5728\uff0c\u90a3\u4e48\u4f60\u7684\u793a\u4f8b\u811a\u672c\u5df2\u7ecf\u6210\u529f\u6267\u884c\u3002\u73b0\u5728\u4f60\u53ef\u4ee5\u4ece ~\/.profile\u00a0\u4e2d\u5220\u9664\u6d4b\u8bd5\u9009\u9879\uff0c\u7559\u4e0b\u8fd9\u4e2a\u4f5c\u4e3a\u4f60\u7684\u6700\u7ec8\u914d\u7f6e\u3002<\/p>\n
anacron -t \/home\/tux\/.local\/etc\/anacrontab \\\r\n-S \/home\/tux\/.var\/spool\/anacron<\/pre>\n\u4f7f\u7528 anacron<\/strong><\/div>\n\u4f60\u5df2\u7ecf\u914d\u7f6e\u597d\u4e86\u4f60\u7684\u4e2a\u4eba\u81ea\u52a8\u5316\u57fa\u7840\u8bbe\u65bd\uff0c\u6240\u4ee5\u4f60\u53ef\u4ee5\u628a\u4efb\u4f55\u4f60\u60f3\u8ba9\u4f60\u7684\u8ba1\u7b97\u673a\u66ff\u4f60\u7ba1\u7406\u7684\u811a\u672c\u653e\u5230\u00a0~\/.local\/etc\/cron.daily\u00a0\u76ee\u5f55\u4e0b\uff0c\u5b83\u5c31\u4f1a\u6309\u8ba1\u5212\u8fd0\u884c\u3002<\/p>\n
\u8fd9\u53d6\u51b3\u4e8e\u4f60\u5e0c\u671b\u4f5c\u4e1a\u8fd0\u884c\u7684\u9891\u7387\u3002\u793a\u4f8b\u811a\u672c\u662f\u6bcf\u5929\u6267\u884c\u4e00\u6b21\u3002\u5f88\u660e\u663e\uff0c\u8fd9\u53d6\u51b3\u4e8e\u4f60\u7684\u8ba1\u7b97\u673a\u5728\u4efb\u4f55\u4e00\u5929\u662f\u5426\u5f00\u673a\u548c\u9192\u7740\u3002\u5982\u679c\u4f60\u5728\u5468\u4e94\u4f7f\u7528\u7535\u8111\uff0c\u4f46\u628a\u5b83\u8bbe\u7f6e\u5728\u5468\u672b\uff0c\u811a\u672c\u5c31\u4e0d\u4f1a\u5728\u5468\u516d\u548c\u5468\u65e5\u8fd0\u884c\u3002\u7136\u800c\uff0c\u5728\u5468\u4e00\uff0c\u811a\u672c\u4f1a\u6267\u884c\uff0c\u56e0\u4e3a anacron \u4f1a\u77e5\u9053\u81f3\u5c11\u6709\u4e00\u5929\u5df2\u7ecf\u8fc7\u53bb\u4e86\u3002\u4f60\u53ef\u4ee5\u5728\u00a0~\/.local\/etc\u00a0\u4e2d\u6dfb\u52a0\u6bcf\u5468\u3001\u6bcf\u4e24\u5468\u3001\u751a\u81f3\u6bcf\u6708\u7684\u76ee\u5f55\uff0c\u4ee5\u5b89\u6392\u5404\u79cd\u5404\u6837\u7684\u95f4\u9694\u3002<\/p>\n
\u8981\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u65f6\u95f4\u95f4\u9694\uff1a<\/p>\n
\u5728\u00a0~\/.local\/etc\u00a0\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u76ee\u5f55\uff08\u4f8b\u5982\u00a0cron.weekly\uff09\u3002\r\n\u5728\u00a0~\/.local\/etc\/anacrontab\u00a0\u4e2d\u6dfb\u52a0\u4e00\u884c\uff0c\u4ee5\u4fbf\u5728\u65b0\u76ee\u5f55\u4e0b\u8fd0\u884c\u811a\u672c\u3002\u5bf9\u4e8e\u6bcf\u5468\u4e00\u6b21\u7684\u95f4\u9694\uff0c\u5176\u914d\u7f6e\u5982\u4e0b\u30027 0 cron.mine run-parts \/home\/tux\/.local\/etc\/cron.weekly\/\uff080\u00a0\u7684\u503c\u53ef\u4ee5\u9009\u62e9\u4e00\u4e9b\u5206\u949f\u6570\uff0c\u4ee5\u9002\u5f53\u5730\u5ef6\u8fdf\u811a\u672c\u7684\u542f\u52a8\uff09\u3002\r\n\u628a\u4f60\u7684\u811a\u672c\u653e\u5728\u00a0cron.weekly\u00a0\u76ee\u5f55\u4e0b\u3002<\/pre>\n\u6b22\u8fce\u6765\u5230\u81ea\u52a8\u5316\u7684\u751f\u6d3b\u65b9\u5f0f\u3002\u5b83\u4e0d\u4f1a\u8ba9\u4eba\u611f\u89c9\u5230\uff0c\u4f46\u4f60\u5c06\u4f1a\u53d8\u5f97\u66f4\u6709\u6548\u7387\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u6211\u6700\u559c\u6b22 Linux \u7684\u4e00\u4e2a\u539f\u56e0\u662f\u5b83\u613f\u610f\u4e3a\u6211\u505a\u5de5\u4f5c\u3002\u6211\u4e0d\u60f3\u6267\u884c\u91cd\u590d\u6027\u7684\u4efb\u52a1\uff0c\u8fd9\u4e9b\u4efb\u52a1\u4f1a\u5360\u7528\u6211\u7684\u65f6\u95f4\uff0c\u6216\u8005\u5bb9\u6613\u51fa […]<\/p>\n","protected":false},"author":323,"featured_media":202541,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-215942","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/215942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/323"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=215942"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/215942\/revisions"}],"predecessor-version":[{"id":215948,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/215942\/revisions\/215948"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/202541"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=215942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=215942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=215942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}